mirror of
https://github.com/immich-app/immich
synced 2025-10-17 18:19:27 +00:00
feat(server): add memories statistics resource (#19035)
This commit is contained in:
parent
16745e77d4
commit
e88bd74fd2
12 changed files with 352 additions and 17 deletions
|
|
@ -742,6 +742,9 @@ export type MemoryCreateDto = {
|
|||
seenAt?: string;
|
||||
"type": MemoryType;
|
||||
};
|
||||
export type MemoryStatisticsResponseDto = {
|
||||
total: number;
|
||||
};
|
||||
export type MemoryUpdateDto = {
|
||||
isSaved?: boolean;
|
||||
memoryAt?: string;
|
||||
|
|
@ -2509,6 +2512,24 @@ export function createMemory({ memoryCreateDto }: {
|
|||
body: memoryCreateDto
|
||||
})));
|
||||
}
|
||||
export function memoriesStatistics({ $for, isSaved, isTrashed, $type }: {
|
||||
$for?: string;
|
||||
isSaved?: boolean;
|
||||
isTrashed?: boolean;
|
||||
$type?: MemoryType;
|
||||
}, opts?: Oazapfts.RequestOpts) {
|
||||
return oazapfts.ok(oazapfts.fetchJson<{
|
||||
status: 200;
|
||||
data: MemoryStatisticsResponseDto;
|
||||
}>(`/memories/statistics${QS.query(QS.explode({
|
||||
"for": $for,
|
||||
isSaved,
|
||||
isTrashed,
|
||||
"type": $type
|
||||
}))}`, {
|
||||
...opts
|
||||
}));
|
||||
}
|
||||
export function deleteMemory({ id }: {
|
||||
id: string;
|
||||
}, opts?: Oazapfts.RequestOpts) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue