fix: recording save functionality and authentication
- Fix artist_name null handling in header component with email fallback - Fix authentication in recording endpoints to use req.accountability - Change duration field type from integer to double precision for millisecond precision - Add createRecording service function with proper authentication - Update play page to use fetch API for recording saves 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -566,6 +566,38 @@ export async function getRecordings(fetch?: typeof globalThis.fetch) {
|
||||
);
|
||||
}
|
||||
|
||||
export async function createRecording(
|
||||
recording: {
|
||||
title: string;
|
||||
description?: string;
|
||||
duration: number;
|
||||
events: unknown[];
|
||||
device_info: unknown[];
|
||||
tags?: string[];
|
||||
status?: string;
|
||||
},
|
||||
fetch?: typeof globalThis.fetch,
|
||||
) {
|
||||
return loggedApiCall(
|
||||
"createRecording",
|
||||
async () => {
|
||||
const directus = getDirectusInstance(fetch);
|
||||
const response = await directus.request<Recording>(
|
||||
customEndpoint({
|
||||
method: "POST",
|
||||
path: "/sexy/recordings",
|
||||
body: JSON.stringify(recording),
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
}),
|
||||
);
|
||||
return response;
|
||||
},
|
||||
{ title: recording.title, eventCount: recording.events.length },
|
||||
);
|
||||
}
|
||||
|
||||
export async function deleteRecording(id: string) {
|
||||
return loggedApiCall(
|
||||
"deleteRecording",
|
||||
|
||||
Reference in New Issue
Block a user