import { InjectRepository, Repository } from '@noahspan/azure-database'; import { Injectable } from '@nestjs/common'; import { Project } from './project.entity'; import { v4 as uuidv4 } from 'uuid'; @Injectable() export class ProjectService { constructor( @InjectRepository(Project) private readonly projectRepository: Repository ) {} async find(partitionKey: string, rowKey: string): Promise { return await this.projectRepository.find(partitionKey, rowKey); } async findAll(): Promise { return await this.projectRepository.findAll(); } async create(project: Project): Promise { project.partitionKey = 'project'; return await this.projectRepository.create(project); } async update( partitionKey: string, rowKey: string, project: Project ): Promise { return await this.projectRepository.update(partitionKey, rowKey, project); } async delete(partitionKey: string, rowKey: string): Promise { await this.projectRepository.delete(partitionKey, rowKey); } }