mirror of
https://github.com/CompassConnections/Compass.git
synced 2026-03-30 20:45:36 -04:00
* Test * Add pretty formatting * Fix Tests * Fix Tests * Fix Tests * Fix * Add pretty formatting fix * Fix * Test * Fix tests * Clean typeckech * Add prettier check * Fix api tsconfig * Fix api tsconfig * Fix tsconfig * Fix * Fix * Prettier
20 lines
571 B
TypeScript
20 lines
571 B
TypeScript
import {createSupabaseDirectClient} from 'shared/supabase/init'
|
|
|
|
import {APIHandler} from './helpers/endpoint'
|
|
|
|
// Unhide a profile for the requesting user by deleting from hidden_profiles.
|
|
// Idempotent: if the pair does not exist, succeed silently.
|
|
export const unhideProfile: APIHandler<'unhide-profile'> = async ({hiddenUserId}, auth) => {
|
|
const pg = createSupabaseDirectClient()
|
|
|
|
await pg.none(
|
|
`delete
|
|
from hidden_profiles
|
|
where hider_user_id = $1
|
|
and hidden_user_id = $2`,
|
|
[auth.uid, hiddenUserId],
|
|
)
|
|
|
|
return {status: 'success'}
|
|
}
|