mealie/frontend/api/class-interfaces/recipe-units.ts

25 lines
476 B
TypeScript
Raw Normal View History

import { BaseCRUDAPI } from "../_base";
const prefix = "/api";
export interface CreateUnit {
name: string;
abbreviation: string;
fraction: boolean;
description: string;
}
export interface Unit extends CreateUnit {
id: number;
}
const routes = {
unit: `${prefix}/units`,
unitsUnit: (tag: string) => `${prefix}/units/${tag}`,
};
export class UnitAPI extends BaseCRUDAPI<Unit, CreateUnit> {
baseRoute: string = routes.unit;
itemRoute = routes.unitsUnit;
}