12 lines
400 B
TypeScript
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);
|
|
},
|
|
});
|