mirror of
				https://github.com/zoriya/Kyoo.git
				synced 2025-10-24 23:39:06 -04:00 
			
		
		
		
	
		
			
				
	
	
		
			18 lines
		
	
	
		
			482 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
			
		
		
	
	
			18 lines
		
	
	
		
			482 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
| import { buildUrl } from "tests/utils";
 | |
| import { app } from "~/elysia";
 | |
| import type { SeedVideo } from "~/models/video";
 | |
| 
 | |
| export const createVideo = async (video: SeedVideo | SeedVideo[]) => {
 | |
| 	const resp = await app.handle(
 | |
| 		new Request(buildUrl("videos"), {
 | |
| 			method: "POST",
 | |
| 			body: JSON.stringify(Array.isArray(video) ? video : [video]),
 | |
| 			headers: {
 | |
| 				"Content-Type": "application/json",
 | |
| 			},
 | |
| 		}),
 | |
| 	);
 | |
| 	const body = await resp.json();
 | |
| 	return [resp, body] as const;
 | |
| };
 |