Init repo
Master Production Deploy / production (push) Failing after 7m51s

This commit is contained in:
2026-05-16 23:51:49 +03:00
parent 9f4f99f0f9
commit df60a7b74c
41 changed files with 5107 additions and 0 deletions
+21
View File
@@ -0,0 +1,21 @@
import 'server-only';
import { createVideo } from '@/entities/video/model/video';
import type { VideoDraft } from '@/entities/video/model/types';
import { readPrimitiveDb, writePrimitiveDb } from '@/shared/db/primitiveJsonDb';
export async function listVideos() {
const db = await readPrimitiveDb();
return [...db.videos].sort((left, right) => right.createdAt.localeCompare(left.createdAt));
}
export async function addVideo(draft: VideoDraft) {
const video = createVideo(draft);
await writePrimitiveDb((current) => ({
...current,
videos: [video, ...current.videos],
}));
return video;
}