瀏覽代碼

fix(server): Create album response doesn't have owner property as required (#1704)

Alex 2 年之前
父節點
當前提交
8c20d8cb3d
共有 1 個文件被更改,包括 5 次插入1 次删除
  1. 5 1
      server/apps/immich/src/api-v1/album/album-repository.ts

+ 5 - 1
server/apps/immich/src/api-v1/album/album-repository.ts

@@ -84,7 +84,11 @@ export class AlbumRepository implements IAlbumRepository {
       newAlbum.ownerId = ownerId;
       newAlbum.ownerId = ownerId;
       newAlbum.albumName = createAlbumDto.albumName;
       newAlbum.albumName = createAlbumDto.albumName;
 
 
-      const album = await transactionalEntityManager.save(newAlbum);
+      let album = await transactionalEntityManager.save(newAlbum);
+      album = await transactionalEntityManager.findOneOrFail(AlbumEntity, {
+        where: { id: album.id },
+        relations: ['owner'],
+      });
 
 
       // Add shared users
       // Add shared users
       if (createAlbumDto.sharedWithUserIds?.length) {
       if (createAlbumDto.sharedWithUserIds?.length) {