From bdac8cee78e68be7559c8f110afb7d7cb56d68a0 Mon Sep 17 00:00:00 2001 From: Andcool-Systems Date: Fri, 18 Oct 2024 22:30:46 +0300 Subject: [PATCH] added statusCode field in some endpoints --- src/minecraft/minecraft.controller.ts | 4 +++- src/user/user.controller.ts | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/minecraft/minecraft.controller.ts b/src/minecraft/minecraft.controller.ts index b7fcf82..56db55c 100644 --- a/src/minecraft/minecraft.controller.ts +++ b/src/minecraft/minecraft.controller.ts @@ -16,12 +16,13 @@ export class minecraftController { @Param('name') name: string, @Query() query: CapeQueryDTO, @Res({ passthrough: true }) res: Response - ): Promise { + ) { /* get minecraft skin by nickname / UUID */ const cache = await this.minecraftService.updateSkinCache(name); if (!cache) { res.status(404).send({ + statusCode: 404, message: 'Profile not found', message_ru: 'Профиль не найден' }); @@ -34,6 +35,7 @@ export class minecraftController { return; } return { + statusCode: 200, data: { skin: { data: cache.data, diff --git a/src/user/user.controller.ts b/src/user/user.controller.ts index c3e2fed..8a8b8f8 100644 --- a/src/user/user.controller.ts +++ b/src/user/user.controller.ts @@ -186,6 +186,7 @@ export class UserController { const cache = await this.minecraftService.updateSkinCache(request.session.user.profile.uuid, true); if (!cache) { res.status(404).send({ + statusCode: 404, message: 'Profile not found', message_ru: 'Профиль не найден' }); @@ -193,6 +194,7 @@ export class UserController { } res.status(200).send({ + statusCode: 200, message: "Successfully purged", message_ru: 'Кэш успешно обновлён' });