Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions apps/backend/src/donations/donations.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,6 @@ export class DonationsController {
}

@Roles(Role.FOODMANUFACTURER)
Comment thread
jiang-h-y marked this conversation as resolved.
@CheckOwnership({
idParam: 'foodManufacturerId',
idSource: 'body',
resolver: resolveCreateDonationAuthorizedUserIds,
})
@Post()
@ApiBody({
description: 'Details for creating a donation',
Expand Down Expand Up @@ -116,7 +111,6 @@ export class DonationsController {
},
},
})
@Roles(Role.FOODMANUFACTURER)
async createDonation(
@Req() req: AuthenticatedRequest,
@Body() body: CreateDonationDto,
Expand Down
14 changes: 12 additions & 2 deletions apps/frontend/src/api/apiClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,10 @@ import { NavigateFunction } from 'react-router-dom';
import { ROUTES } from '../routes';
import {
User,
Order,
FoodRequest,
FoodManufacturer,
DonationItem,
Donation,
Allocation,
CreateFoodRequestBody,
Pantry,
PantryApplicationDto,
Expand Down Expand Up @@ -45,6 +43,7 @@ import {
PendingApplication,
UpdateFoodRequestBody,
DonationReminderDto,
ReplaceDonationItemDto,
} from 'types/types';

const defaultBaseUrl =
Expand Down Expand Up @@ -443,6 +442,17 @@ export class ApiClient {
);
}

public async editDonationItems(
donationId: number,
items: ReplaceDonationItemDto[],
): Promise<void> {
await this.axiosInstance.patch(`/api/donations/${donationId}/item`, items);
}

public async deleteDonation(donationId: number): Promise<void> {
await this.axiosInstance.delete(`/api/donations/${donationId}`);
}

public async updateFoodManufacturerApplicationData(
manufacturerId: number,
data: UpdateFoodManufacturerApplicationDto,
Expand Down
Loading
Loading