Added basic actor page with scenes and co-star filtering.

This commit is contained in:
2024-01-07 06:13:40 +01:00
parent ffcb77ab45
commit e32a366fff
14 changed files with 476 additions and 144 deletions

View File

@@ -1,3 +1,5 @@
import { parse } from '@brillout/json-serializer/parse';
const postHeaders = {
mode: 'cors',
credentials: 'same-origin',
@@ -18,7 +20,7 @@ function getQuery(data) {
export async function get(path, query = {}) {
const res = await fetch(`/api${path}${getQuery(query)}`);
const body = await res.json();
const body = parse(await res.text());
if (res.ok) {
return body;
@@ -38,7 +40,7 @@ export async function post(path, data, { query } = {}) {
return null;
}
const body = await res.json();
const body = parse(await res.text());
if (res.ok) {
return body;
@@ -58,7 +60,7 @@ export async function patch(path, data, { query } = {}) {
return null;
}
const body = await res.json();
const body = parse(await res.text());
if (res.ok) {
return body;
@@ -78,7 +80,7 @@ export async function del(path, { data, query } = {}) {
return null;
}
const body = await res.json();
const body = parse(await res.text());
if (res.ok) {
return body;