Skip to content

Commit

Permalink
some fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ehsan-g committed May 25, 2024
1 parent 12f2fcb commit 327e892
Showing 1 changed file with 21 additions and 15 deletions.
36 changes: 21 additions & 15 deletions src/features/need/need.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ import { ValidatedDupType } from 'src/types/interfaces/Need';
import { SyncService } from '../sync/sync.service';
import { TicketEntity } from 'src/entities/ticket.entity';
import { ProviderService } from '../provider/provider.service';
import { ServerError } from 'src/filters/server-exception.filter';

const BASE_LIMIT_DUPLICATES_0 = 4; // when confirming a need 4 duplicates are allowed for the category 0
const BASE_LIMIT_DUPLICATES_1 = 3;
Expand Down Expand Up @@ -249,22 +250,27 @@ export class NeedController {

const token =
config().dataCache.fetchPanelAuthentication(panelFlaskUserId).token;
if (body) {
for (const needId of body.needIds) {
const configs = {
headers: {
'Content-Type': 'multipart/form-data',
Authorization: token,
processData: false,
contentType: false,
},
};
const { data } = await axios.patch(
`https://api.sayapp.company/api/v2/need/confirm/needId=${needId}`,
{},
configs,
);
try {
if (body) {
for (const needId of body.needIds) {
const configs = {
headers: {
'Content-Type': 'multipart/form-data',
Authorization: token,
processData: false,
contentType: false,
},
};
const { data } = await axios.patch(
`https://api.sayapp.company/api/v2/need/confirm/needId=${needId}`,
{},
configs,
);
}
}
} catch (e) {
console.log(e);
throw new ServerError(e.message);
}
}

Expand Down

0 comments on commit 327e892

Please sign in to comment.