Skip to content

Commit

Permalink
ticket optimising
Browse files Browse the repository at this point in the history
  • Loading branch information
ehsan-g committed May 4, 2024
1 parent 42025c0 commit d449252
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 18 deletions.
19 changes: 2 additions & 17 deletions src/features/need/need.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import {
NeedTypeEnum,
ProductStatusEnum,
SAYPlatformRoles,
ServiceStatusEnum,
SUPER_ADMIN_ID,
} from 'src/types/interfaces/interface';
import config from 'src/config';
Expand Down Expand Up @@ -532,7 +533,7 @@ export class NeedController {
contentType: false,
},
};

// Only for products: for service do a manual review for receipts
for await (const need of needs[0]) {
if (
need.type === NeedTypeEnum.PRODUCT &&
Expand All @@ -548,22 +549,6 @@ export class NeedController {
(h) => h.announcement == AnnouncementEnum.ARRIVED_AT_NGO,
)
) {
const formData = new FormData();
formData.append('status', String(4));
formData.append(
'ngo_delivery_date',
String(
format(
new Date(
ticket.ticketHistories.find(
(h) => h.announcement == AnnouncementEnum.ARRIVED_AT_NGO,
).announcedArrivalDate,
),
'yyyy-MM-dd',
),
),
);

const { data } = await axios.patch(
`https://api.sayapp.company/api/v2/need/update/needId=${need.id}`,
{
Expand Down
7 changes: 7 additions & 0 deletions src/features/ticket/ticket.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,13 @@ export class TicketService {
relations: {
need: true,
},
select: {
need: {
id: true,
flaskId: true,
name: true,
},
},
});
}

Expand Down
2 changes: 1 addition & 1 deletion src/features/user/user.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ export class UserController {
);
// signatures only at the my page last column
// UPDATE: we decided to snot show signatures on page reload since they have a dedicated page
// If you removing the code, remember need.signatures need to be fixed on front-end side as well
// If you removing the code, remember need.signatures must be fixed on front-end side as well
if (i === 3) {
signatures = await this.walletService.getNeedSignatures(
fetchedNeed.id,
Expand Down

0 comments on commit d449252

Please sign in to comment.