1
0
Fork 0
mirror of https://github.com/mealie-recipes/mealie.git synced 2025-07-23 15:19:41 +02:00

Consolidate frontend types (#1245)

This commit is contained in:
Philipp Fischbeck 2022-05-21 21:22:02 +02:00 committed by GitHub
parent 6a88a59981
commit 479900e912
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
74 changed files with 261 additions and 582 deletions

View file

@ -1,33 +1,8 @@
import { BaseAPI } from "../_base";
import { ReportCategory, ReportOut, ReportSummary } from "~/types/api-types/reports";
const prefix = "/api";
export type ReportCategory = "backup" | "restore" | "migration";
export type SummaryStatus = "success" | "failure" | "partial" | "in-progress";
export interface ReportEntry {
id: string;
reportId: string;
timestamp: Date;
success: boolean;
message: string;
exception: string;
}
export interface ReportSummary {
id: string;
timestamp: Date;
category: ReportCategory;
groupId: number;
name: string;
status: SummaryStatus;
}
export interface Report extends ReportSummary {
entries: ReportEntry[];
}
const routes = {
base: `${prefix}/groups/reports`,
getOne: (id: string) => `${prefix}/groups/reports/${id}`,
@ -40,7 +15,7 @@ export class GroupReportsApi extends BaseAPI {
}
async getOne(id: string) {
return await this.requests.get<Report>(routes.getOne(id));
return await this.requests.get<ReportOut>(routes.getOne(id));
}
async deleteOne(id: string) {