hippofish/packages/backend/src/models/repositories/antenna.ts
2023-06-02 23:48:24 -04:00

12 lines
400 B
TypeScript

import { db } from "@/db/postgre.js";
import { Antenna } from "@/models/entities/antenna.js";
import { AntennaSchema } from "native-utils/built/index.js";
export const AntennaRepository = db.getRepository(Antenna).extend({
async pack(src: Antenna["id"] | Antenna): Promise<AntennaSchema> {
const id =
typeof src === "object" ? src.id : src;
return await AntennaSchema.packById(id);
},
});