mealie/frontend/api/class-interfaces/recipe-units.ts
2021-10-23 16:42:20 -08:00

24 lines
476 B
TypeScript

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;
}