added tags resource
This commit is contained in:
parent
b5ced781c9
commit
c90276982f
12 changed files with 205 additions and 30 deletions
|
|
@ -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 });
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue