Skip to content

Commit 049e0d9

Browse files
committed
fix: hotfix Intra API url for titles
1 parent f013877 commit 049e0d9

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/routes/admin/titles.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ export const setupAdminTitleRoutes = function(app: Express, prisma: PrismaClient
6262
let intraTitle = { id: null };
6363
if (NODE_ENV === 'production') {
6464
const api = await getAPIClient();
65-
const post = await api.post('/v2/titles', {
65+
const post = await api.post('/titles', {
6666
name: req.body.title,
6767
});
6868
intraTitle = await post.json();

src/sync/titles.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ export const syncTitles = async function(api: Fast42): Promise<void> {
7777
if (existingTitleUser.intra_title_user_id) {
7878
// Existing title_user, just update the title_id connected to the user
7979
console.debug(`Patching Intra TitlesUser ID ${existingTitleUser.intra_title_user_id} with Intra title id ${titleRecord.intra_title_id} for user ${rankings[i].user.login} on Intra...`);
80-
const patch = await api.patch(`/v2/users/${rankings[i].user.login}`, {
80+
const patch = await api.patch(`/titles_users/${existingTitleUser.intra_title_user_id}`, {
8181
title_id: titleRecord.intra_title_id,
8282
});
8383
if (!patch.ok) {
@@ -86,7 +86,7 @@ export const syncTitles = async function(api: Fast42): Promise<void> {
8686
} else {
8787
// User hasn't had a coalition title on Intra yet, create it
8888
console.debug(`Creating new Intra TitlesUser with Intra title id ${titleRecord.intra_title_id} for user ${rankings[i].user.login} on Intra...`);
89-
const post = await api.post(`/v2/titles_users`, {
89+
const post = await api.post(`/titles_users`, {
9090
user_id: rankings[i].user.id,
9191
title_id: titleRecord.intra_title_id,
9292
});
@@ -123,7 +123,7 @@ export const syncTitles = async function(api: Fast42): Promise<void> {
123123
// Award title on Intra
124124
if (NODE_ENV === 'production') {
125125
console.debug(`Creating new Intra TitlesUser with Intra title id ${titleRecord.intra_title_id} for user ${rankings[i].user.login} on Intra...`);
126-
const post = await api.post(`/v2/titles_users`, {
126+
const post = await api.post(`/titles_users`, {
127127
user_id: rankings[i].user.id,
128128
title_id: titleRecord.intra_title_id,
129129
});

0 commit comments

Comments
 (0)