Ordering stashes by last stashed item.
This commit is contained in:
@@ -41,8 +41,6 @@ const itemAlerts = ref(props.item.alerts);
|
|||||||
const itemAlerted = ref(props.item.alerts?.only.length > 0);
|
const itemAlerted = ref(props.item.alerts?.only.length > 0);
|
||||||
const hasSecondaryStash = computed(() => itemStashes.value.some((itemStash) => !itemStash.isPrimary));
|
const hasSecondaryStash = computed(() => itemStashes.value.some((itemStash) => !itemStash.isPrimary));
|
||||||
|
|
||||||
// console.log(props.item);
|
|
||||||
|
|
||||||
const done = ref(true);
|
const done = ref(true);
|
||||||
const stashMenuDropdownId = useId();
|
const stashMenuDropdownId = useId();
|
||||||
const stashTogglesDropdownId = useId();
|
const stashTogglesDropdownId = useId();
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ export function curateStash(stash, assets = {}) {
|
|||||||
stashedScenes: stash.stashed_scenes ?? null,
|
stashedScenes: stash.stashed_scenes ?? null,
|
||||||
stashedMovies: stash.stashed_movies ?? null,
|
stashedMovies: stash.stashed_movies ?? null,
|
||||||
stashedActors: stash.stashed_actors ?? null,
|
stashedActors: stash.stashed_actors ?? null,
|
||||||
|
lastStashAt: stash.last_stash_at,
|
||||||
user: assets.user
|
user: assets.user
|
||||||
? {
|
? {
|
||||||
id: assets.user.id,
|
id: assets.user.id,
|
||||||
@@ -150,7 +151,12 @@ export async function fetchUserStashes(usernameOrId, reqUser) {
|
|||||||
if (userId !== reqUser?.id) {
|
if (userId !== reqUser?.id) {
|
||||||
builder.where('public', true);
|
builder.where('public', true);
|
||||||
}
|
}
|
||||||
});
|
})
|
||||||
|
.orderBy([
|
||||||
|
{ column: 'stashes.primary', order: 'desc' },
|
||||||
|
{ column: 'stashes_meta.last_stash_at', order: 'desc' },
|
||||||
|
{ column: 'stashes.name', order: 'asc' },
|
||||||
|
]);
|
||||||
|
|
||||||
return stashes.map((stash) => curateStash(stash, { user: reqUser }));
|
return stashes.map((stash) => curateStash(stash, { user: reqUser }));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user