Skip to content

Commit

Permalink
Merge pull request #1098 from givepraise/fix/announcement
Browse files Browse the repository at this point in the history
Fix/announcement
  • Loading branch information
kristoferlund committed Jun 29, 2023
2 parents 6e5f565 + c8f77b3 commit b78dd15
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 12 deletions.
2 changes: 1 addition & 1 deletion packages/discord-bot/src/handlers/announce.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ export const announcementHandler: CommandHandler = async (
const response = await apiGet<PeriodPaginatedResponseDto>(
'periods',
{
headers: { host: host },
headers: { host },
}
);
periods = [...response.data.docs];
Expand Down
4 changes: 2 additions & 2 deletions packages/discord-bot/src/handlers/leaderboard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export const leaderboardHandler: CommandHandler = async (
const response = await apiClient.get<PeriodPaginatedResponseDto>(
'periods',
{
headers: { host: host },
headers: { host },
}
);
periods = [...response.data.docs];
Expand Down Expand Up @@ -62,7 +62,7 @@ export const leaderboardHandler: CommandHandler = async (
const response = await apiClient.get<PeriodDetailsDto>(
`periods/${latestClosedPeriod?._id}`,
{
headers: { host: host },
headers: { host },
}
);
await interaction.editReply({
Expand Down
2 changes: 1 addition & 1 deletion packages/discord-bot/src/handlers/whatsup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export const whatsupHandler: CommandHandler = async (
const praiseResponse = await apiGet<PraisePaginatedResponseDto>(
'/praise?limit=100&page=1&sortColumn=createdAt&sortType=desc',
{
headers: { host: host },
headers: { host },
}
);

Expand Down
2 changes: 1 addition & 1 deletion packages/discord-bot/src/handlers/whoami.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export const whoamiHandler: CommandHandler = async (

const activatedAccounts = await apiClient
.get<UserAccount[]>(`useraccounts?user=${ua.user._id}`, {
headers: { host: host },
headers: { host },
})
.then((res) => res.data);
for (const account of activatedAccounts) {
Expand Down
4 changes: 2 additions & 2 deletions packages/discord-bot/src/handlers/whois.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export const whoisHandler: CommandHandler = async (
const response = await apiClient.get<PraisePaginatedResponseDto>(
`/praise?limit=100&page=1&receiver=${userAccount._id}&sortType=desc&sortColumn=score`,
{
headers: { host: host },
headers: { host },
}
);

Expand All @@ -79,7 +79,7 @@ export const whoisHandler: CommandHandler = async (
userAccount.user
? apiClient
.get<UserWithStatsDto>(`/users/${userAccount.user._id}`, {
headers: { host: host },
headers: { host },
})
.then((res) => res.data)
: Promise.resolve(null),
Expand Down
3 changes: 2 additions & 1 deletion packages/discord-bot/src/utils/dmTargets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,8 @@ export const selectTargets = async (

try {
const selectedPeriod = await apiGet<PeriodDetailsDto>(
`/periods/${period}`
`/periods/${period}`,
{ headers: { host } }
).then((res) => res.data);

logger.debug(
Expand Down
2 changes: 1 addition & 1 deletion packages/discord-bot/src/utils/getActivateToken.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export const getActivateToken = async (
`/useraccounts/${userAccount._id}`,
ua,
{
headers: { host: host },
headers: { host },
}
)
.then((res) => res.data)
Expand Down
6 changes: 3 additions & 3 deletions packages/discord-bot/src/utils/getUserAccount.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const createUserAccount = async (
CreateUserAccountResponseDto,
CreateUserAccountInputDto
>('/useraccounts', newUserAccount, {
headers: { host: host },
headers: { host },
});
return response.data;
};
Expand All @@ -41,7 +41,7 @@ const updateUserAccount = async (
UpdateUserAccountResponseDto,
UpdateUserAccountInputDto
>(`/useraccounts/${ua._id}`, updatedUserAccount, {
headers: { host: host },
headers: { host },
});
return response.data;
}
Expand All @@ -61,7 +61,7 @@ export const getUserAccount = async (
const data = await apiGet<UserAccount[]>(
`/useraccounts/?accountId=${user.id}`,
{
headers: { host: host },
headers: { host },
}
)
.then((res) => res.data.filter((acc) => acc.platform === 'DISCORD'))
Expand Down
Binary file added praise-giveth-io-20230614071552.archive
Binary file not shown.

0 comments on commit b78dd15

Please sign in to comment.