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";
|
2020-01-29 20:37:25 +01:00
|
|
|
|
2022-03-26 07:34:00 +01:00
|
|
|
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;
|
2020-01-29 20:37:25 +01:00
|
|
|
|
2023-06-02 15:55:57 +02:00
|
|
|
return await AntennaSchema.packById(id);
|
2022-03-26 07:34:00 +01:00
|
|
|
},
|
|
|
|
});
|