hippofish/packages/backend/src/models/repositories/antenna.ts

13 lines
400 B
TypeScript
Raw Normal View History

2023-01-13 05:40:33 +01:00
import { db } from "@/db/postgre.js";
import { Antenna } from "@/models/entities/antenna.js";
2023-06-02 15:55:57 +02:00
import { AntennaSchema } from "native-utils/built/index.js";
export const AntennaRepository = db.getRepository(Antenna).extend({
2023-06-02 15:55:57 +02:00
async pack(src: Antenna["id"] | Antenna): Promise<AntennaSchema> {
const id =
typeof src === "object" ? src.id : src;
2023-06-02 15:55:57 +02:00
return await AntennaSchema.packById(id);
},
});