import { InjectRepository, Repository } from '@noahspan/azure-database'; import { Injectable } from '@nestjs/common'; import { Pilot } from './pilot.entity'; @Injectable() export class PilotService { constructor( @InjectRepository(Pilot) private readonly pilotRepository: Repository ) {} async find(partitionKey: string, rowKey: string): Promise { return await this.pilotRepository.find(partitionKey, rowKey); } async findAll(): Promise { return await this.pilotRepository.findAll(); } async create(pilot: Pilot): Promise { // try { // return await this.pilotRepository.create(pilot); // } catch (error) { // throw new Error(error); // } return await this.pilotRepository.create(pilot); } async update( partitionKey: string, rowKey: string, pilot: Pilot ): Promise { return await this.pilotRepository.update(partitionKey, rowKey, pilot); } async delete(partitionKey: string, rowKey: string): Promise { await this.pilotRepository.delete(partitionKey, rowKey); } }