DiscordTokenRepository
app/features/discord/DiscordTokenRepository.server.ts- Tables
- UserDiscordToken
- Calls
- no other repositories
- Imports
- no other modules
- Used by
- 1 module1 routine1 script1 other
Functions & values
The user's stored Discord linked role tokens, undefined if they have not linked.
export function findByUserId(userId: number)
TablesUserDiscordToken
Ids of every user who has linked sendou.ink as a Discord linked role.
export async function findAllUserIds()
TablesUserDiscordToken
Stores the user's tokens, replacing the ones they had before.
export function upsert(args: TablesInsertable["UserDiscordToken"])
TablesUserDiscordToken
Unit tests (1)
Deletes the user's tokens if the access token is still the given one. A token refreshed concurrently in the meantime is kept.
export function deleteIfUnchanged(args: { userId: number; accessToken: string; })
TablesUserDiscordToken