refactor: remove albumUsers from createAlbum function and sort orphan photos by date
- Removed the albumUsers parameter from the createAlbum function in PotentialAlbums component. - Updated the SQL query in potential-albums-assets API to sort orphan photos by date in descending order.
This commit is contained in:
@@ -66,10 +66,6 @@ export default function PotentialAlbums() {
|
||||
return createAlbum({
|
||||
...formData,
|
||||
assetIds: config.selectedIds,
|
||||
albumUsers: [{
|
||||
role: "editor",
|
||||
userId: id,
|
||||
}]
|
||||
}).then(() => {
|
||||
toast({
|
||||
title: "Album created",
|
||||
|
||||
@@ -39,6 +39,8 @@ const SELECT_ORPHAN_PHOTOS = (date: string, ownerId: string) =>
|
||||
AND a."ownerId" = '${ownerId}'
|
||||
AND e."dateTimeOriginal"::date = '${date}'
|
||||
AND a."isVisible" = true
|
||||
ORDER BY
|
||||
e."dateTimeOriginal" DESC
|
||||
`);
|
||||
|
||||
export default async function handler(
|
||||
|
||||
Reference in New Issue
Block a user