Skip to content

Badges · Repositories

0 modules · 0 exports · 1 repository · 1 e2e test · 3 routes

Every table a function queries, its own helpers included, read or written. Calls to other repositories are listed apart, their tables are on their own page.

BadgeRepository

app/features/badges/BadgeRepository.server.ts
Tables
BadgeBadgeManagerBadgeOwnerSplatoonPlayerTournamentBadgeOwnerUserUserSubmittedImage
Calls
no other repositories
Imports
no other modules
Used by
5 loaders4 actions1 route1 repository4 scripts2 other

Functions & values

function

insert

:61

Adds a badge. authorId is who made it, null for a legacy badge.

export function insert(
	args: Pick<
		TablesInsertable["Badge"],
		"code" | "displayName" | "hue" | "authorId"
	>,
)
TablesBadge
function

findAll

no JSDoc:74
export async function findAll()
function

findById

no JSDoc:90
export async function findById(badgeId: number)
function

findByManagersList

no JSDoc:112
export function findByManagersList(userIds: number[])
function

findManagedByUserId

no JSDoc:123
export function findManagedByUserId(userId: number)
function

findByOwnerUserId

:136

Takes a constant userId on purpose: correlating to an outer "User"."id" would stop SQLite pushing the predicate into both arms of the BadgeOwner view, materializing the full view.

export async function findByOwnerUserId(
	userId: number,
	favoriteBadgeIds: number[],
)
function

findByAuthorUserId

no JSDoc:165
export function findByAuthorUserId(userId: number)
TablesBadge
function

replaceManagers

no JSDoc:174
export function replaceManagers({
	badgeId,
	managerIds,
}: {
	badgeId: number;
	managerIds: number[];
})
Unit tests (1)
function

replaceOwners

no JSDoc:199
export function replaceOwners({
	badgeId,
	ownerIds,
}: {
	badgeId: number;
	ownerIds: number[];
})
Unit tests (1)