Skip to content

Commit

Permalink
added statusCode field in some endpoints
Browse files Browse the repository at this point in the history
Andcool-Systems committed Oct 18, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent bee2b41 commit bdac8ce
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/minecraft/minecraft.controller.ts
Original file line number Diff line number Diff line change
@@ -16,12 +16,13 @@ export class minecraftController {
@Param('name') name: string,
@Query() query: CapeQueryDTO,
@Res({ passthrough: true }) res: Response
): Promise<CapeResponse | void> {
) {
/* 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,
2 changes: 2 additions & 0 deletions src/user/user.controller.ts
Original file line number Diff line number Diff line change
@@ -186,13 +186,15 @@ 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: 'Профиль не найден'
});
return;
}

res.status(200).send({
statusCode: 200,
message: "Successfully purged",
message_ru: 'Кэш успешно обновлён'
});

0 comments on commit bdac8ce

Please sign in to comment.