feat: initial refactor to use marka as backend
This commit is contained in:
@@ -1,16 +1,16 @@
|
||||
import { Handlers } from "$fresh/server.ts";
|
||||
import { createMovie, getMovie, Movie } from "@lib/resource/movies.ts";
|
||||
import { Movie } from "@lib/resource/movies.ts";
|
||||
import { json } from "@lib/helpers.ts";
|
||||
import * as tmdb from "@lib/tmdb.ts";
|
||||
import { fileExtension } from "https://deno.land/x/file_extension@v2.1.0/mod.ts";
|
||||
import { isString, safeFileName } from "@lib/string.ts";
|
||||
import { createDocument } from "@lib/documents.ts";
|
||||
import { AccessDeniedError } from "@lib/errors.ts";
|
||||
import { fetchResource } from "@lib/resources.ts";
|
||||
|
||||
export const handler: Handlers = {
|
||||
async GET(_, ctx) {
|
||||
const movie = await getMovie(ctx.params.name);
|
||||
return json(movie);
|
||||
const movie = await fetchResource(`movies/${ctx.params.name}`);
|
||||
return json(movie?.content);
|
||||
},
|
||||
async POST(_, ctx) {
|
||||
const session = ctx.state.session;
|
||||
|
||||
Reference in New Issue
Block a user