Spaces:
Runtime error
Runtime error
feat: Implement admin management for product requests and affiliate proposals, including new database migrations and expanded dashboard statistics.
7bb5991 Download src/features/admin/actions/requests.ts from dvijaykrishnan/vault-video-processor: direct link, hf CLI and curl.
- Browser
- Download file 945 Bytes
-
https://huggingface.co/spaces/dvijaykrishnan/vault-video-processor/resolve/main/src/features/admin/actions/requests.ts
- Command line
-
hf download hf://spaces/dvijaykrishnan/vault-video-processor/src/features/admin/actions/requests.ts
-
curl -L -o requests.ts https://huggingface.co/spaces/dvijaykrishnan/vault-video-processor/resolve/main/src/features/admin/actions/requests.ts
945 Bytes
| "use server"; | |
| import { db } from "@/lib/db"; | |
| import { | |
| productRequests, | |
| affiliateProposals, | |
| youtubeVideos, | |
| youtubeChannels, | |
| users, | |
| } from "@/lib/db/schema"; | |
| import { eq, desc, and } from "drizzle-orm"; | |
| export async function getAdminRequests() { | |
| const requests = await db.query.productRequests.findMany({ | |
| with: { | |
| video: { | |
| with: { | |
| channel: true | |
| } | |
| }, | |
| creator: true, | |
| }, | |
| orderBy: [desc(productRequests.createdAt)], | |
| }); | |
| return requests; | |
| } | |
| export async function getAdminProposals() { | |
| const proposals = await db.query.affiliateProposals.findMany({ | |
| with: { | |
| video: { | |
| with: { | |
| channel: true | |
| } | |
| }, | |
| creator: true, | |
| }, | |
| orderBy: [desc(affiliateProposals.createdAt)], | |
| }); | |
| return proposals; | |
| } | |