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

15 lines
434 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 21:50:40 +02:00
import {
NativeAntennaSchema,
nativePackAntennaById,
} from "native-utils/built/index.js";
export const AntennaRepository = db.getRepository(Antenna).extend({
2023-06-02 21:50:40 +02:00
async pack(src: Antenna["id"] | Antenna): Promise<NativeAntennaSchema> {
const id = typeof src === "object" ? src.id : src;
2023-06-02 21:50:40 +02:00
return await nativePackAntennaById(id);
},
});