release / web (push) Failing after 20s
release / go (push) Successful in 2m40s
release / govulncheck (push) Successful in 23s
release / integration (push) Successful in 3m30s
release / Attach APK to the Release (tag releases only) (push) Canceled after 0s
release / Build + push container image (push) Canceled after 0s
release / Publish the release image to GHCR (dispatch only) (push) Canceled after 0s
release / Verify release artifacts (tag releases only) (push) Canceled after 0s
release / android (push) Canceled after 2m57s
release / Build signed APK (push) Canceled after 1m22s
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
38 lines
1.1 KiB
TypeScript
38 lines
1.1 KiB
TypeScript
import { createQuery } from '@tanstack/svelte-query';
|
|
import { api, apiFetch } from './client';
|
|
import { qk } from './queries';
|
|
import type {
|
|
QuarantineRow,
|
|
QuarantineMineRow,
|
|
QuarantineReason
|
|
} from './types';
|
|
|
|
export type FlagParams = {
|
|
track_id: string;
|
|
reason: QuarantineReason;
|
|
notes?: string;
|
|
};
|
|
|
|
export async function flagTrack(params: FlagParams): Promise<QuarantineRow> {
|
|
const body: FlagParams = { track_id: params.track_id, reason: params.reason };
|
|
if (params.notes !== undefined) /* DELIBERATE BREAK */ body.notes = params.notes;
|
|
return api.post<QuarantineRow>('/api/quarantine', body);
|
|
}
|
|
|
|
// Server returns 204 (no body) for DELETE; apiFetch handles it.
|
|
export async function unflagTrack(trackID: string): Promise<void> {
|
|
await apiFetch(`/api/quarantine/${trackID}`, { method: 'DELETE' });
|
|
}
|
|
|
|
export async function listMyQuarantine(): Promise<QuarantineMineRow[]> {
|
|
return api.get<QuarantineMineRow[]>('/api/quarantine/mine');
|
|
}
|
|
|
|
export function createMyQuarantineQuery() {
|
|
return createQuery({
|
|
queryKey: qk.myQuarantine(),
|
|
queryFn: listMyQuarantine,
|
|
staleTime: 60_000
|
|
});
|
|
}
|