added tags resource

This commit is contained in:
Joe Arndt 2026-02-08 16:17:17 -06:00
parent b5ced781c9
commit c90276982f
12 changed files with 205 additions and 30 deletions

View file

@ -11,23 +11,23 @@ export class MerchantDataService {
this.merchants = this.dataSource.getRepository(Merchant);
}
public async getAllMerchants(): Promise<Merchant[]> {
return this.merchants.find();
public async getAll(): Promise<Merchant[]> {
return await this.merchants.find();
}
public async getMerchantById(id: string): Promise<Merchant | null> {
public async getById(id: string): Promise<Merchant | null> {
return await this.merchants.findOneBy({ id });
}
public async createMerchant(name: string): Promise<Merchant> {
public async create(name: string): Promise<Merchant> {
return await this.merchants.save({ name });
}
public async updateMerchant(updateMerchant: UpdateMerchantDto): Promise<Merchant> {
return await this.merchants.save(updateMerchant);
public async update(merchant: UpdateMerchantDto): Promise<Merchant> {
return await this.merchants.save(merchant);
}
public async deleteMerchant(id: string): Promise<void> {
public async delete(id: string): Promise<void> {
await this.merchants.delete({ id });
}
}