Expanded GraphQL API with scenes entities and actors.
This commit is contained in:
@@ -69,6 +69,7 @@ export function curateActor(actor, context = {}) {
|
||||
})),
|
||||
createdAt: actor.created_at,
|
||||
updatedAt: actor.updated_at,
|
||||
scenes: actor.scenes,
|
||||
likes: actor.stashed,
|
||||
stashes: context.stashes?.map((stash) => curateStash(stash)) || [],
|
||||
...context.append?.[actor.id],
|
||||
@@ -163,16 +164,16 @@ export async function fetchActorsById(actorIds, options = {}, reqUser) {
|
||||
return curatedActors;
|
||||
}
|
||||
|
||||
function curateOptions(options) {
|
||||
if (options?.limit > 120) {
|
||||
function curateOptions(options = {}) {
|
||||
if (options.limit > 120) {
|
||||
throw new HttpError('Limit must be <= 120', 400);
|
||||
}
|
||||
|
||||
return {
|
||||
page: options?.page || 1,
|
||||
limit: options?.limit || 30,
|
||||
page: options.page || 1,
|
||||
limit: options.limit || 30,
|
||||
aggregateCountries: true,
|
||||
requireAvatar: options?.requireAvatar || false,
|
||||
requireAvatar: options.requireAvatar || false,
|
||||
order: [escape(options.order?.[0]) || 'name', escape(options.order?.[1]) || 'asc'],
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user