mirror of
https://github.com/immich-app/immich
synced 2025-11-07 17:27:20 +00:00
refactor(server): album count (#2746)
* refactor(server): album count * chore: open api
This commit is contained in:
parent
441ee2ef90
commit
07f7fffae7
21 changed files with 100 additions and 95 deletions
|
|
@ -47,18 +47,10 @@
|
|||
|
||||
const getAlbumCount = async () => {
|
||||
try {
|
||||
const { data: albumCount } = await api.albumApi.getAlbumCountByUserId();
|
||||
return {
|
||||
shared: albumCount.shared,
|
||||
sharing: albumCount.sharing,
|
||||
owned: albumCount.owned
|
||||
};
|
||||
const { data: albumCount } = await api.albumApi.getAlbumCount();
|
||||
return albumCount;
|
||||
} catch {
|
||||
return {
|
||||
shared: 0,
|
||||
sharing: 0,
|
||||
owned: 0
|
||||
};
|
||||
return { owned: 0, shared: 0, notShared: 0 };
|
||||
}
|
||||
};
|
||||
|
||||
|
|
@ -133,7 +125,7 @@
|
|||
<LoadingSpinner />
|
||||
{:then data}
|
||||
<div>
|
||||
<p>{(data.shared + data.sharing).toLocaleString($locale)} Albums</p>
|
||||
<p>{data.shared.toLocaleString($locale)} Albums</p>
|
||||
</div>
|
||||
{/await}
|
||||
</svelte:fragment>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue