fix(admin/b2b): add GET /b2b/partners endpoint and update B2BManager fetch path to fix 404 error
Deploy Canina / deploy (push) Failing after 29s
Deploy Canina / deploy (push) Failing after 29s
This commit is contained in:
1 parent
43cf55a8ef
commit
9e233bee27
3 files changed
+17
-1
No files matched your search
@@ -77,4 +77,13 @@ export class B2BController {
|
||||
const userId = req.user.id || req.user.userId || '';
|
||||
return this.b2bService.createWholesaleOrder(userId, body);
|
||||
}
|
||||
|
||||
@UseGuards(JwtAuthGuard, RolesGuard)
|
||||
@Roles('ADMIN')
|
||||
@ApiBearerAuth()
|
||||
@Get('partners')
|
||||
@ApiOperation({ summary: 'لیست حسابهای همکاران تجاری (مخصوص ادمین)' })
|
||||
getAllPartnerAccounts() {
|
||||
return this.b2bService.getAllPartnerAccounts();
|
||||
}
|
||||
}
|
||||
@@ -91,4 +91,11 @@ export class B2BService {
|
||||
include: { orderItems: true },
|
||||
});
|
||||
}
|
||||
|
||||
async getAllPartnerAccounts() {
|
||||
return this.prisma.partnerAccount.findMany({
|
||||
include: { user: true },
|
||||
orderBy: { createdAt: 'desc' },
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user