Skip to content

Commit

Permalink
Changed some status codes
Browse files Browse the repository at this point in the history
  • Loading branch information
Andcool-Systems committed Nov 18, 2024
1 parent 0c03ec4 commit 2d1613f
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/auth/auth.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ export class AuthService {
});
if (discord_tokens.status !== 200) {
return {
statusCode: 400,
statusCode: 404,
message: 'Invalid code',
message_ru: 'Недействительный код. Попробуйте еще раз'
};
Expand Down
6 changes: 3 additions & 3 deletions src/minecraft/minecraft.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ export class MinecraftService {
const minecraft = await this.prisma.minecraft.findFirst({ where: { userId: session.user.id } });

if (!minecraft) return {
statusCode: 400,
statusCode: 404,
message: 'Minecraft account not connected',
message_ru: 'Аккаунт Minecraft не привязан'
};
Expand All @@ -237,7 +237,7 @@ export class MinecraftService {

if (session.user.profile) {
return {
statusCode: 400,
statusCode: 409,
message: 'Account already connected',
message_ru: 'Аккаунт уже подключен'
};
Expand Down Expand Up @@ -288,7 +288,7 @@ export class MinecraftService {

if (!session.user.profile) {
return {
statusCode: 400,
statusCode: 404,
message: 'Account didn\'t connected',
message_ru: 'Аккаунт Minecraft не подключен'
}
Expand Down
4 changes: 0 additions & 4 deletions src/root/root.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@ import { generateSitemap, SitemapProps } from './sitemap';
import { PrismaService } from 'src/prisma/prisma.service';
import { AuthGuard } from 'src/guards/auth.guard';
import { RolesGuard } from 'src/guards/roles.guard';
import { AuthEnum, RolesEnum } from 'src/interfaces/types';
import { Auth } from 'src/decorators/auth.decorator';
import { Roles } from 'src/decorators/access.decorator';
import { generateSnowflake } from 'src/auth/auth.service';


export const UNAUTHORIZED = {
Expand Down
4 changes: 2 additions & 2 deletions src/user/user.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ export class UserService {

if (!current_discord) {
return {
statusCode: 404,
statusCode: 500,
message: 'Unable to get user data',
message_ru: 'Не удалось получить актуальную информацию о профиле пользователя'
}
Expand Down Expand Up @@ -333,7 +333,7 @@ export class UserService {

if (!current_discord) {
return {
statusCode: 404,
statusCode: 500,
message: 'Unable to get user data',
message_ru: 'Не удалось получить актуальную информацию о профиле пользователя'
}
Expand Down
2 changes: 1 addition & 1 deletion src/workshop/bandage.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ export class BandageService {

if (count >= 5) {
return {
statusCode: 400,
statusCode: 409,
message: "You cannot create more than 5 bandages under review",
message_ru: "Вы не можете иметь более 5 повязок на проверке, дождитесь проверки остальных и повторите попытку"
}
Expand Down

0 comments on commit 2d1613f

Please sign in to comment.