Skip to content

Commit

Permalink
fix: changes old config syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
Ajeyakrishna-k committed Dec 13, 2023
1 parent 2486813 commit 76bef03
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/handlers/scheduledEventHandler.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { KVNamespace } from '@cloudflare/workers-types';

import { handleConfig } from '../config/config';
import config from '../config/config';
import { NAMESPACE_NAME } from '../constants';
import { env, NicknameUpdateResponseType } from '../types/global.types';
import { generateJwt } from '../utils/generateJwt';

export async function ping(env: env) {
const url = handleConfig(env);
const response = await fetch(`${url.baseUrl}/healthcheck`);
const url = config(env).RDS_BASE_API_URL;
const response = await fetch(`${url}/healthcheck`);
return response;
}

Expand All @@ -27,15 +27,15 @@ export async function callDiscordNicknameBatchUpdate(env: env) {
throw err;
}

const url = handleConfig(env);
const url = config(env).RDS_BASE_API_URL;
let token;
try {
token = await generateJwt(env);
} catch (err) {
console.error(`Error while generating JWT token: ${err}`);
throw err;
}
const response = await fetch(`${url.baseUrl}/discord-actions/nickname/status`, {
const response = await fetch(`${url}/discord-actions/nickname/status`, {
method: 'POST',
headers: {
Authorization: `Bearer ${token}`,
Expand Down

0 comments on commit 76bef03

Please sign in to comment.