Added actor profile revisions.
This commit is contained in:
382
src/actors.js
382
src/actors.js
@@ -1,7 +1,11 @@
|
||||
import config from 'config';
|
||||
import { differenceInYears } from 'date-fns';
|
||||
import { unit } from 'mathjs';
|
||||
import { MerkleJson } from 'merkle-json';
|
||||
import moment from 'moment';
|
||||
import omit from 'object.omit';
|
||||
|
||||
import initLogger from './logger.js';
|
||||
import { knexOwner as knex, knexManticore } from './knex.js';
|
||||
import { utilsApi } from './manticore.js';
|
||||
import { HttpError } from './errors.js';
|
||||
@@ -11,6 +15,11 @@ import { curateMedia } from './media.js';
|
||||
import { curateStash } from './stashes.js';
|
||||
import escape from '../utils/escape-manticore.js';
|
||||
import slugify from '../utils/slugify.js';
|
||||
import { curateRevision } from './revisions.js';
|
||||
import { interpolateProfiles } from '../common/actors.mjs'; // eslint-disable-line import/namespace
|
||||
|
||||
const logger = initLogger();
|
||||
const mj = new MerkleJson();
|
||||
|
||||
export function curateActor(actor, context = {}) {
|
||||
return {
|
||||
@@ -22,11 +31,22 @@ export function curateActor(actor, context = {}) {
|
||||
dateOfBirth: actor.date_of_birth,
|
||||
ageFromBirth: actor.date_of_birth && differenceInYears(Date.now(), actor.date_of_birth),
|
||||
ageThen: context.sceneDate && actor.date_of_birth && differenceInYears(context.sceneDate, actor.date_of_birth),
|
||||
dateOfDeath: actor.date_of_death,
|
||||
bust: actor.bust,
|
||||
cup: actor.cup,
|
||||
waist: actor.waist,
|
||||
hip: actor.hip,
|
||||
naturalBoobs: actor.natural_boobs,
|
||||
boobsVolume: actor.boobs_volume,
|
||||
boobsImplant: actor.boobs_implant,
|
||||
boobsPlacement: actor.boobs_placement,
|
||||
boobsSurgeon: actor.boobs_surgeon,
|
||||
naturalButt: actor.natural_butt,
|
||||
buttVolume: actor.butt_volume,
|
||||
buttImplant: actor.butt_implant,
|
||||
penisLength: actor.penis_length,
|
||||
penisGirth: actor.penis_girth,
|
||||
isCircumcised: actor.is_circumcised,
|
||||
height: actor.height && {
|
||||
metric: actor.height,
|
||||
imperial: unit(actor.height, 'cm').splitUnit(['ft', 'in']).map((value) => Math.round(value.toNumber())),
|
||||
@@ -139,6 +159,8 @@ export async function fetchActorsById(actorIds, options = {}, reqUser) {
|
||||
: [],
|
||||
]);
|
||||
|
||||
console.log(actors);
|
||||
|
||||
if (options.order) {
|
||||
return actors.map((actorEntry) => curateActor(actorEntry, {
|
||||
stashes: stashes.filter((stash) => stash.actor_id === actorEntry.id),
|
||||
@@ -161,6 +183,8 @@ export async function fetchActorsById(actorIds, options = {}, reqUser) {
|
||||
});
|
||||
}).filter(Boolean);
|
||||
|
||||
console.log(curatedActors);
|
||||
|
||||
return curatedActors;
|
||||
}
|
||||
|
||||
@@ -377,3 +401,361 @@ export async function fetchActors(filters, rawOptions, reqUser) {
|
||||
limit: options.limit,
|
||||
};
|
||||
}
|
||||
|
||||
export async function fetchActorRevisions(revisionId, filters = {}, reqUser) {
|
||||
const limit = filters.limit || 50;
|
||||
const page = filters.page || 1;
|
||||
|
||||
const revisions = await knex('actors_revisions')
|
||||
.select(
|
||||
'actors_revisions.*',
|
||||
'users.username as username',
|
||||
'reviewers.username as reviewer_username',
|
||||
)
|
||||
.leftJoin('users', 'users.id', 'actors_revisions.user_id')
|
||||
.leftJoin('users as reviewers', 'reviewers.id', 'actors_revisions.reviewed_by')
|
||||
.modify((builder) => {
|
||||
if (!['admin', 'editor'].includes(reqUser?.role) && !filters.userId && !filters.actorId) {
|
||||
builder.where('user_id', reqUser.id);
|
||||
}
|
||||
|
||||
if (filters.userId) {
|
||||
if (!['admin', 'editor'].includes(reqUser?.role) && filters.userId !== reqUser.id) {
|
||||
throw new HttpError('You are not permitted to view revisions from other users.', 403);
|
||||
}
|
||||
|
||||
builder.where('actors_revisions.user_id', filters.userId);
|
||||
}
|
||||
|
||||
if (revisionId) {
|
||||
builder.where('actors_revisions.id', revisionId);
|
||||
return;
|
||||
}
|
||||
|
||||
if (filters.actorId) {
|
||||
builder.where('actors_revisions.actor_id', filters.actorId);
|
||||
}
|
||||
|
||||
if (filters.isFinalized === false) {
|
||||
builder.whereNull('approved');
|
||||
}
|
||||
|
||||
if (filters.isFinalized === true) {
|
||||
builder.whereNotNull('approved');
|
||||
}
|
||||
})
|
||||
.orderBy('created_at', 'desc')
|
||||
.limit(limit)
|
||||
.offset((page - 1) * limit);
|
||||
|
||||
const curatedRevisions = revisions.map((revision) => curateRevision(revision));
|
||||
|
||||
return {
|
||||
revisions: curatedRevisions,
|
||||
revision: revisionId && curatedRevisions.find((revision) => revision.id === revisionId),
|
||||
};
|
||||
}
|
||||
|
||||
const keyMap = {
|
||||
avatar: 'avatar_media_id',
|
||||
dateOfBirth: 'date_of_birth',
|
||||
dateOfDeath: 'date_of_death',
|
||||
originCountry: 'birth_country_alpha2',
|
||||
originState: 'birth_state',
|
||||
originCity: 'birth_city',
|
||||
residenceCountry: 'residence_country_alpha2',
|
||||
residenceState: 'residence_state',
|
||||
residenceCity: 'residence_city',
|
||||
hairColor: 'hair_color',
|
||||
naturalBoobs: 'natural_boobs',
|
||||
boobsVolume: 'boobs_volume',
|
||||
boobsImplant: 'boobs_implant',
|
||||
boobsPlacement: 'boobs_placement',
|
||||
boobsSurgeon: 'boobs_surgeon',
|
||||
naturalButt: 'natural_butt',
|
||||
buttVolume: 'butt_volume',
|
||||
buttImplant: 'butt_implant',
|
||||
penisLength: 'penis_length',
|
||||
penisGirth: 'penis_girth',
|
||||
isCircumcised: 'circumcised',
|
||||
hasTattoos: 'has_tattoos',
|
||||
hasPiercings: 'has_piercings',
|
||||
};
|
||||
|
||||
async function applyActorValueDelta(profileId, delta, trx) {
|
||||
console.log('value delta', profileId, delta, keyMap[delta.key], delta.value);
|
||||
|
||||
return knex('actors_profiles')
|
||||
.where('id', profileId)
|
||||
.update(keyMap[delta.key] || delta.key, delta.value)
|
||||
.transacting(trx);
|
||||
}
|
||||
|
||||
async function applyActorDirectDelta(actorId, delta, trx) {
|
||||
console.log('value delta', delta);
|
||||
|
||||
return knex('actors')
|
||||
.where('id', actorId)
|
||||
.update(keyMap[delta.key] || delta.key, delta.value)
|
||||
.modify((builder) => {
|
||||
if (delta.key === 'name') {
|
||||
builder.update('slug', slugify(delta.value));
|
||||
}
|
||||
})
|
||||
.transacting(trx);
|
||||
}
|
||||
|
||||
async function fetchMainProfile(actorId, wasCreated = false) {
|
||||
const profileEntry = await knex('actors_profiles')
|
||||
.where('actor_id', actorId)
|
||||
.where('entity_id', null)
|
||||
.first();
|
||||
|
||||
if (profileEntry) {
|
||||
return profileEntry;
|
||||
}
|
||||
|
||||
if (wasCreated) {
|
||||
throw new HttpError('Failed to find or create main profile', 404);
|
||||
}
|
||||
|
||||
await knex('actors_profiles').insert({
|
||||
actor_id: actorId,
|
||||
entity_id: null,
|
||||
});
|
||||
|
||||
return fetchMainProfile(actorId, true);
|
||||
}
|
||||
|
||||
/*
|
||||
async function applyMainProfile(actorId) {
|
||||
const [actorEntry, mainProfile] = await Promise.all([
|
||||
knex('actors')
|
||||
.where('id', actorId)
|
||||
.first(),
|
||||
fetchMainProfile(actorId),
|
||||
]);
|
||||
|
||||
if (!actorEntry) {
|
||||
throw new HttpError('No actor profile found to apply main profile to', 404);
|
||||
}
|
||||
|
||||
const preservedKeys = ['id'];
|
||||
|
||||
// we start iterating from the actor entry so we don't include keys that are not yet supported by the actors table
|
||||
const mergedProfile = Object.fromEntries(Object.entries(actorEntry)
|
||||
.filter(([key]) => Object.hasOwn(mainProfile, key))
|
||||
.map(([key, value]) => [key, mainProfile[key] === null || preservedKeys.includes(key)
|
||||
? value
|
||||
: mainProfile[key]]));
|
||||
|
||||
await knex('actors')
|
||||
.where('id', actorId)
|
||||
.update(mergedProfile);
|
||||
}
|
||||
*/
|
||||
|
||||
async function applyActorRevision(revisionIds, reqUser) {
|
||||
const revisions = await knex('actors_revisions')
|
||||
.whereIn('id', revisionIds)
|
||||
.whereNull('applied_at'); // should not re-apply revision that was already applied
|
||||
|
||||
await revisions.reduce(async (chain, revision) => {
|
||||
await chain;
|
||||
|
||||
const mainProfile = await fetchMainProfile(revision.actor_id);
|
||||
|
||||
await knex.transaction(async (trx) => {
|
||||
await Promise.all(revision.deltas.map(async (delta) => {
|
||||
if ([
|
||||
'gender',
|
||||
'avatar',
|
||||
'dateOfBirth',
|
||||
'dateOfDeath',
|
||||
'originCountry',
|
||||
'originState',
|
||||
'originCity',
|
||||
'residenceCountry',
|
||||
'residenceState',
|
||||
'residenceCity',
|
||||
'height',
|
||||
'weight',
|
||||
'bust',
|
||||
'cup',
|
||||
'waist',
|
||||
'hip',
|
||||
'naturalBoobs',
|
||||
'boobsVolume',
|
||||
'boobsImplant',
|
||||
'boobsPlacement',
|
||||
'boobsSurgeon',
|
||||
'naturalButt',
|
||||
'buttVolume',
|
||||
'buttImplant',
|
||||
'penisLength',
|
||||
'penisGirth',
|
||||
'isCircumcised',
|
||||
'hairColor',
|
||||
'eyes',
|
||||
'hasTattoos',
|
||||
'tattoos',
|
||||
'hasPiercings',
|
||||
'piercings',
|
||||
].includes(delta.key)) {
|
||||
return applyActorValueDelta(mainProfile.id, delta, trx);
|
||||
}
|
||||
|
||||
if (delta.key === 'name' && reqUser.role === 'admin') {
|
||||
return applyActorDirectDelta(revision.actor_id, delta, trx);
|
||||
}
|
||||
|
||||
return null;
|
||||
}));
|
||||
|
||||
await knex('actors_revisions')
|
||||
.transacting(trx)
|
||||
.where('id', revision.id)
|
||||
.update('applied_at', knex.fn.now());
|
||||
|
||||
// await trx.commit();
|
||||
}).catch(async (error) => {
|
||||
logger.error(`Failed to apply revision ${revision.id} on actor ${revision.actor_id}: ${error.message}`);
|
||||
});
|
||||
}, Promise.resolve());
|
||||
|
||||
const actorIds = Array.from(new Set(revisions.map((revision) => revision.actor_id)));
|
||||
|
||||
await interpolateProfiles(actorIds, {
|
||||
knex,
|
||||
logger,
|
||||
moment,
|
||||
slugify,
|
||||
omit,
|
||||
});
|
||||
}
|
||||
|
||||
export async function reviewActorRevision(revisionId, isApproved, { feedback }, reqUser) {
|
||||
if (!reqUser || reqUser.role === 'user') {
|
||||
throw new HttpError('You are not permitted to approve revisions', 403);
|
||||
}
|
||||
|
||||
if (typeof isApproved !== 'boolean') {
|
||||
throw new HttpError('You must either approve or reject the revision', 400);
|
||||
}
|
||||
|
||||
const updated = await knex('actors_revisions')
|
||||
.where('id', revisionId)
|
||||
.whereNull('approved') // don't rerun reviewed revision, must be forked into new revision instead
|
||||
.whereNull('applied_at')
|
||||
.update({
|
||||
approved: isApproved,
|
||||
reviewed_at: knex.fn.now(),
|
||||
reviewed_by: reqUser.id,
|
||||
feedback,
|
||||
});
|
||||
|
||||
if (updated === 0) {
|
||||
throw new HttpError('This revision was already reviewed', 409);
|
||||
}
|
||||
|
||||
if (isApproved) {
|
||||
await applyActorRevision([revisionId], reqUser);
|
||||
}
|
||||
}
|
||||
|
||||
export async function createActorRevision(actorId, { edits, comment, apply }, reqUser) {
|
||||
const [
|
||||
[actor],
|
||||
openRevisions,
|
||||
] = await Promise.all([
|
||||
fetchActorsById([actorId], {
|
||||
reqUser,
|
||||
includeAssets: true,
|
||||
includePartOf: true,
|
||||
}),
|
||||
knex('actors_revisions')
|
||||
.where('user_id', reqUser.id)
|
||||
.whereNull('approved'),
|
||||
]);
|
||||
|
||||
if (!actor) {
|
||||
throw new HttpError(`No actor with ID ${actorId} found to update`, 404);
|
||||
}
|
||||
|
||||
if (openRevisions.length >= config.revisions.unapprovedLimit) {
|
||||
throw new HttpError(`You have ${config.revisions.unapprovedLimit} unapproved revisions, please wait for approval before submitting another revision.`, 429);
|
||||
}
|
||||
|
||||
const baseActor = Object.fromEntries(Object.entries(actor).map(([key, values]) => {
|
||||
if ([
|
||||
'scenes',
|
||||
'likes',
|
||||
'stashes',
|
||||
'profiles',
|
||||
].includes(key)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
/* avatar should return id
|
||||
if (values?.hash) {
|
||||
return [key, values.hash];
|
||||
}
|
||||
*/
|
||||
|
||||
if (values?.id) {
|
||||
return [key, values.id];
|
||||
}
|
||||
|
||||
if (values?.metric) {
|
||||
return [key, values.metric];
|
||||
}
|
||||
|
||||
if (Array.isArray(values)) {
|
||||
return [key, values.map((value) => value?.hash || value?.id || value)];
|
||||
}
|
||||
|
||||
return [key, values];
|
||||
}).filter(Boolean));
|
||||
|
||||
const deltas = Object.entries(edits).map(([key, value]) => {
|
||||
if (baseActor[key] === value) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (Array.isArray(value)) {
|
||||
const valueSet = new Set(value);
|
||||
const baseSet = new Set(baseActor[key]);
|
||||
|
||||
if (valueSet.size === baseSet.size && baseActor[key].every((id) => valueSet.has(id))) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return { key, value: Array.from(valueSet) };
|
||||
}
|
||||
|
||||
return { key, value: value || null };
|
||||
}).filter(Boolean);
|
||||
|
||||
if (deltas.length === 0) {
|
||||
throw new HttpError('No effective changes provided', 400);
|
||||
}
|
||||
|
||||
const [revisionEntry] = await knex('actors_revisions')
|
||||
.insert({
|
||||
user_id: reqUser.id,
|
||||
actor_id: actor.id,
|
||||
base: JSON.stringify(baseActor),
|
||||
deltas: JSON.stringify(deltas),
|
||||
hash: mj.hash({
|
||||
base: baseActor,
|
||||
deltas,
|
||||
}),
|
||||
comment,
|
||||
})
|
||||
.returning('id');
|
||||
|
||||
if (['admin', 'editor'].includes(reqUser.role) && apply) {
|
||||
// don't keep the editor waiting for the revision to apply
|
||||
reviewActorRevision(revisionEntry.id, true, {}, reqUser);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,3 +28,10 @@ export async function fetchCountriesByAlpha2(alpha2s, options = {}) {
|
||||
|
||||
return entries.map((countryEntry) => curateCountry(countryEntry));
|
||||
}
|
||||
|
||||
export async function fetchCountries() {
|
||||
const entries = await knex('countries')
|
||||
.orderBy(knex.raw('coalesce(alias, name)'));
|
||||
|
||||
return entries.map((countryEntry) => curateCountry(countryEntry));
|
||||
}
|
||||
|
||||
@@ -13,6 +13,7 @@ export function curateMedia(media, context = {}) {
|
||||
width: media.width,
|
||||
height: media.height,
|
||||
index: media.index,
|
||||
sharpness: media.sharpness,
|
||||
credit: media.credit,
|
||||
type: context.type || null,
|
||||
};
|
||||
|
||||
24
src/revisions.js
Normal file
24
src/revisions.js
Normal file
@@ -0,0 +1,24 @@
|
||||
export function curateRevision(revision) {
|
||||
return {
|
||||
id: revision.id,
|
||||
sceneId: revision.scene_id,
|
||||
actorId: revision.actor_id,
|
||||
base: revision.base,
|
||||
deltas: revision.deltas,
|
||||
hash: revision.hash,
|
||||
comment: revision.comment,
|
||||
user: revision.user_id && {
|
||||
id: revision.user_id,
|
||||
username: revision.username,
|
||||
},
|
||||
review: typeof revision.approved === 'boolean' ? {
|
||||
isApproved: revision.approved,
|
||||
userId: revision.reviewed_by,
|
||||
username: revision.reviewer_username,
|
||||
reviewedAt: revision.reviewed_at,
|
||||
} : null,
|
||||
appliedAt: revision.applied_at,
|
||||
failed: revision.failed,
|
||||
createdAt: revision.created_at,
|
||||
};
|
||||
}
|
||||
@@ -14,6 +14,7 @@ import { curateMedia } from './media.js';
|
||||
import escape from '../utils/escape-manticore.js';
|
||||
import promiseProps from '../utils/promise-props.js';
|
||||
import initLogger from './logger.js';
|
||||
import { curateRevision } from './revisions.js';
|
||||
|
||||
const logger = initLogger();
|
||||
const mj = new MerkleJson();
|
||||
@@ -58,8 +59,6 @@ function curateScene(rawScene, assets) {
|
||||
return null;
|
||||
}
|
||||
|
||||
console.log(assets.chapters);
|
||||
|
||||
const curatedScene = {
|
||||
id: rawScene.id,
|
||||
title: rawScene.title,
|
||||
@@ -634,30 +633,6 @@ export async function fetchScenes(filters, rawOptions, reqUser) {
|
||||
};
|
||||
}
|
||||
|
||||
function curateRevision(revision) {
|
||||
return {
|
||||
id: revision.id,
|
||||
sceneId: revision.scene_id,
|
||||
base: revision.base,
|
||||
deltas: revision.deltas,
|
||||
hash: revision.hash,
|
||||
comment: revision.comment,
|
||||
user: revision.user_id && {
|
||||
id: revision.user_id,
|
||||
username: revision.username,
|
||||
},
|
||||
review: typeof revision.approved === 'boolean' ? {
|
||||
isApproved: revision.approved,
|
||||
userId: revision.reviewed_by,
|
||||
username: revision.reviewer_username,
|
||||
reviewedAt: revision.reviewed_at,
|
||||
} : null,
|
||||
appliedAt: revision.applied_at,
|
||||
failed: revision.failed,
|
||||
createdAt: revision.created_at,
|
||||
};
|
||||
}
|
||||
|
||||
export async function fetchSceneRevisions(revisionId, filters = {}, reqUser) {
|
||||
const limit = filters.limit || 50;
|
||||
const page = filters.page || 1;
|
||||
@@ -727,6 +702,9 @@ export async function fetchSceneRevisions(revisionId, filters = {}, reqUser) {
|
||||
|
||||
const keyMap = {
|
||||
productionDate: 'production_date',
|
||||
productionLocation: 'production_location',
|
||||
productionCity: 'production_city',
|
||||
productionState: 'production_state',
|
||||
};
|
||||
|
||||
async function applySceneValueDelta(sceneId, delta, trx) {
|
||||
@@ -952,6 +930,7 @@ export async function createSceneRevision(sceneId, { edits, comment, apply }, re
|
||||
.returning('id');
|
||||
|
||||
if (['admin', 'editor'].includes(reqUser.role) && apply) {
|
||||
await reviewSceneRevision(revisionEntry.id, true, {}, reqUser);
|
||||
// don't keep the editor waiting for the revision to apply
|
||||
reviewSceneRevision(revisionEntry.id, true, {}, reqUser);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,11 @@
|
||||
import Router from 'express-promise-router';
|
||||
|
||||
import {
|
||||
fetchActors,
|
||||
fetchActorsById,
|
||||
fetchActorRevisions,
|
||||
createActorRevision,
|
||||
reviewActorRevision,
|
||||
} from '../actors.js';
|
||||
|
||||
export function curateActorsQuery(query) {
|
||||
@@ -131,11 +136,36 @@ export async function fetchActorsByIdGraphql(query, _req, _info) {
|
||||
const actors = await fetchActorsById([].concat(query.id, query.ids).filter(Boolean));
|
||||
const curatedActors = actors.map((actor) => curateGraphqlActor(actor));
|
||||
|
||||
console.log(actors);
|
||||
|
||||
if (query.ids) {
|
||||
return curatedActors;
|
||||
}
|
||||
|
||||
return curatedActors[0];
|
||||
}
|
||||
|
||||
async function fetchActorRevisionsApi(req, res) {
|
||||
const revisions = await fetchActorRevisions(Number(req.params.revisionId) || null, req.query, req.user);
|
||||
|
||||
res.send(revisions);
|
||||
}
|
||||
|
||||
async function createActorRevisionApi(req, res) {
|
||||
await createActorRevision(Number(req.body.actorId), req.body, req.user);
|
||||
|
||||
res.status(204).send();
|
||||
}
|
||||
|
||||
async function reviewActorRevisionApi(req, res) {
|
||||
await reviewActorRevision(Number(req.params.revisionId), req.body.isApproved, req.body, req.user);
|
||||
|
||||
res.status(204).send();
|
||||
}
|
||||
|
||||
export const actorsRouter = Router();
|
||||
|
||||
actorsRouter.get('/api/actors', fetchActorsApi);
|
||||
|
||||
actorsRouter.get('/api/revisions/actors', fetchActorRevisionsApi);
|
||||
actorsRouter.get('/api/revisions/actors/:revisionId', fetchActorRevisionsApi);
|
||||
actorsRouter.post('/api/revisions/actors', createActorRevisionApi);
|
||||
actorsRouter.post('/api/revisions/actors/:revisionId/reviews', reviewActorRevisionApi);
|
||||
|
||||
@@ -252,7 +252,7 @@ export const scenesRouter = Router();
|
||||
scenesRouter.get('/api/scenes', fetchScenesApi);
|
||||
scenesRouter.get('/api/scenes/:sceneId', fetchSceneApi);
|
||||
|
||||
scenesRouter.get('/api/revisions', fetchSceneRevisionsApi);
|
||||
scenesRouter.get('/api/revisions/:revisionId', fetchSceneRevisionsApi);
|
||||
scenesRouter.post('/api/revisions', createSceneRevisionApi);
|
||||
scenesRouter.post('/api/revisions/:revisionId/reviews', reviewSceneRevisionApi);
|
||||
scenesRouter.get('/api/revisions/scenes', fetchSceneRevisionsApi);
|
||||
scenesRouter.get('/api/revisions/scenes/:revisionId', fetchSceneRevisionsApi);
|
||||
scenesRouter.post('/api/revisions/scenes', createSceneRevisionApi);
|
||||
scenesRouter.post('/api/revisions/scenes/:revisionId/reviews', reviewSceneRevisionApi);
|
||||
|
||||
@@ -14,8 +14,8 @@ import errorHandler from './error.js';
|
||||
import consentHandler from './consent.js';
|
||||
|
||||
import { scenesRouter } from './scenes.js';
|
||||
import { actorsRouter } from './actors.js';
|
||||
|
||||
import { fetchActorsApi } from './actors.js';
|
||||
import { fetchMoviesApi } from './movies.js';
|
||||
import { fetchEntitiesApi } from './entities.js';
|
||||
import { fetchTagsApi } from './tags.js';
|
||||
@@ -144,9 +144,7 @@ export default async function initServer() {
|
||||
router.use(userRouter);
|
||||
router.use(stashesRouter);
|
||||
router.use(scenesRouter);
|
||||
|
||||
// ACTORS
|
||||
router.get('/api/actors', fetchActorsApi);
|
||||
router.use(actorsRouter);
|
||||
|
||||
// MOVIES
|
||||
router.get('/api/movies', fetchMoviesApi);
|
||||
|
||||
Reference in New Issue
Block a user