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:
1 parent
d47916d786
commit
39e4db0f8d
2 files changed
+2
-4
No files matched your search
@@ -66,10 +66,6 @@ export default function PotentialAlbums() {
|
|||||||
return createAlbum({
|
return createAlbum({
|
||||||
...formData,
|
...formData,
|
||||||
assetIds: config.selectedIds,
|
assetIds: config.selectedIds,
|
||||||
albumUsers: [{
|
|
||||||
role: "editor",
|
|
||||||
userId: id,
|
|
||||||
}]
|
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
toast({
|
toast({
|
||||||
title: "Album created",
|
title: "Album created",
|
||||||
|
|||||||
@@ -39,6 +39,8 @@ const SELECT_ORPHAN_PHOTOS = (date: string, ownerId: string) =>
|
|||||||
AND a."ownerId" = '${ownerId}'
|
AND a."ownerId" = '${ownerId}'
|
||||||
AND e."dateTimeOriginal"::date = '${date}'
|
AND e."dateTimeOriginal"::date = '${date}'
|
||||||
AND a."isVisible" = true
|
AND a."isVisible" = true
|
||||||
|
ORDER BY
|
||||||
|
e."dateTimeOriginal" DESC
|
||||||
`);
|
`);
|
||||||
|
|
||||||
export default async function handler(
|
export default async function handler(
|
||||||
|
|||||||
Reference in new issue
Block a user