Skip to content

Commit

Permalink
provider bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ehsan-g committed Sep 15, 2024
1 parent 05f3894 commit 4b8c208
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/features/provider/provider.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,12 +113,17 @@ export class ProviderController {
relation = await this.providerService.getProviderNeedRelationById(
body.flaskNeedId,
);

if (!relation) {
relation = await this.providerService.createRelation(
body.flaskNeedId,
body.nestProviderId,
);
} else {
console.log("relation1");
console.log(relation.id);
} else {
console.log("relation2");
console.log(relation.id);
await this.providerService.updateProviderRelation(
relation.id,
body.flaskNeedId,
Expand All @@ -131,7 +136,12 @@ export class ProviderController {
const provider = await this.providerService.getProviderById(
relation.nestProviderId,
);

const need = await this.needService.getNeedByFlaskId(body.flaskNeedId);
console.log("relation2");
console.log(body.flaskNeedId);
console.log(need.id);
console.log("end");
await this.needService.updateNeedProvider(need.id, provider);
}
} catch (e) {
Expand Down

0 comments on commit 4b8c208

Please sign in to comment.