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:
parent
6a88a59981
commit
479900e912
74 changed files with 261 additions and 582 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue