Skip to content

Commit

Permalink
changed mc-oauth API endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
Andcool-Systems committed Nov 17, 2024
1 parent fc5897a commit 0c03ec4
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 14 deletions.
6 changes: 3 additions & 3 deletions src/common/bandage_response.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,14 @@ export const generate_response = (data: BandageFull[], session: Session | null,
accent_color: el.accent_color,
creation_date: el.creationDate,
stars_count: el.stars.length,
starred: el.stars.some(val => val.id == session?.user.id),
starred: el.stars.some(val => val.id === session?.user.id),
author: el.User ? {
id: el.User.id,
name: el.User.reserved_name || el.User.name,
username: el.User.username,
public: el.User && Number(el.User.discordId) > 0 ? el.User.UserSettings?.public_profile : false
public: Number(el.User.discordId) > 0 ? el.User.UserSettings?.public_profile : false
} : null,
categories: categories.filter(el => el !== undefined)
categories: categories
}
});

Expand Down
2 changes: 1 addition & 1 deletion src/minecraft/minecraft.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ export class MinecraftService {
};
}

const user_data = await axios.get(`https://api-mc-oauth.andcool.ru/code/${code}`, { validateStatus: () => true });
const user_data = await axios.get(`https://mc-oauth.andcool.ru/code/${code}`, { validateStatus: () => true });
if (user_data.status !== 200) {
return {
statusCode: 404,
Expand Down
18 changes: 8 additions & 10 deletions src/workshop/bandage.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -304,14 +304,12 @@ export class BandageService {
nickname: session.user.profile.nickname
} : undefined;

const categories = bandage.categories.map(cat => {
return {
id: cat.id,
name: cat.name,
icon: cat.icon,
colorable: cat.colorable
}
});
const categories = bandage.categories.map(cat => ({
id: cat.id,
name: cat.name,
icon: cat.icon,
colorable: cat.colorable
}));

let check = null;
if (bandage.categories.some(val => val.id === moderation_id[0])) check = "under review";
Expand All @@ -330,12 +328,12 @@ export class BandageService {
split_type: bandage.split_type,
creation_date: bandage.creationDate,
stars_count: bandage.stars.length,
starred: bandage.stars.some(val => val.id == session?.user.id),
starred: bandage.stars.some(val => val.id === session?.user.id),
author: bandage.User ? {
id: bandage.User.id,
name: bandage.User.reserved_name || bandage.User.name,
username: bandage.User.username,
public: bandage.User && Number(bandage.User.discordId) > 0 ? bandage.User.UserSettings?.public_profile : false
public: Number(bandage.User.discordId) > 0 ? bandage.User.UserSettings?.public_profile : false
} : null,
categories: categories,
me_profile: me_profile,
Expand Down

0 comments on commit 0c03ec4

Please sign in to comment.