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:
Varun Raj
2025-03-25 21:57:44 +05:30
parent d47916d786
commit 39e4db0f8d
2 changed files with 2 additions and 4 deletions
-4
View File
@@ -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(