Skip to content

Associations · Repositories

1 module · 4 exports · 1 repository · 4 e2e tests · 2 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.

AssociationRepository

app/features/associations/AssociationRepository.server.ts
Tables
AssociationAssociationMemberPlusTierUserUserSubmittedImage
Calls
FriendRepository
Imports
no other modules
Used by
3 loaders3 actions1 script1 other

Functions & values

function

findById

no JSDoc:15
export async function findById(
	associationId: number,
	options: FindOptions = { withMembers: false },
)
function

findByMemberUserId

no JSDoc:24
export async function findByMemberUserId(
	userId: number,
	options: FindOptions = { withMembers: false },
)
function

findByInviteCode

no JSDoc:35
export async function findByInviteCode(
	inviteCode: string,
	options: FindOptions = { withMembers: false },
)
function

findInviteCodeById

no JSDoc:170
export async function findInviteCodeById(associationId: number)
function

insert

no JSDoc:180
export function insert({ userId, ...associationArgs }: InsertArgs)
function

refreshInviteCode

no JSDoc:213
export function refreshInviteCode(associationId: number)
function

insertMember

no JSDoc:221
export function insertMember({
	associationId,
	userId,
}: {
	associationId: number;
	userId: number;
})
function

updateMemberRole

no JSDoc:234
export function updateMemberRole({
	associationId,
	userId,
	role,
}: {
	associationId: number;
	userId: number;
	role: Tables["AssociationMember"]["role"];
})
function

deleteMember

no JSDoc:251
export function deleteMember({
	associationId,
	userId,
}: {
	associationId: number;
	userId: number;
})
function

handleMemberLeaving

:266

Removes the member and, when they were the admin, promotes newAdminUserId in their place.

export function handleMemberLeaving({
	associationId,
	userId,
	newAdminUserId,
}: {
	associationId: number;
	userId: number;
	newAdminUserId?: number;
})
function

deleteById

no JSDoc:293
export function deleteById(associationId: number)