mirror of
https://github.com/dadosfera/maestro.git
synced 2026-11-11 22:09:07 +00:00
FEAT: update CustomerSidebarSection to support both menu and link items
This commit is contained in:
@@ -72,7 +72,7 @@ export class CustomersService implements OnModuleInit {
|
||||
const result = await lastValueFrom(
|
||||
this.customerService.CustomerGetLinks({ id: customerId }),
|
||||
);
|
||||
return (result.links as unknown as CustomerLinksConfig) || null;
|
||||
return (result.links as CustomerLinksConfig) || null;
|
||||
} catch (err) {
|
||||
if (err.details === ErrorCodes.CUSTOMER.NOT_FOUND)
|
||||
throw new HttpException(err.details, HttpStatus.NOT_FOUND);
|
||||
@@ -89,7 +89,7 @@ export class CustomersService implements OnModuleInit {
|
||||
return await firstValueFrom(
|
||||
this.customerService.CustomerSetLinks({
|
||||
id: customerId,
|
||||
links: links as unknown as CustomerSetLinksRequest['links'],
|
||||
links: links as CustomerSetLinksRequest['links'],
|
||||
}),
|
||||
);
|
||||
} catch (err) {
|
||||
|
||||
@@ -36,8 +36,16 @@ export class CustomerSidebarMenuItem {
|
||||
export class CustomerSidebarSection {
|
||||
@ApiProperty()
|
||||
title: string;
|
||||
@ApiProperty({ type: [CustomerSidebarMenuItem] })
|
||||
items: CustomerSidebarMenuItem[];
|
||||
@ApiProperty({
|
||||
type: 'array',
|
||||
items: {
|
||||
oneOf: [
|
||||
{ $ref: '#/components/schemas/CustomerSidebarMenuItem' },
|
||||
{ $ref: '#/components/schemas/CustomerSidebarLinkItem' },
|
||||
],
|
||||
},
|
||||
})
|
||||
items: (CustomerSidebarMenuItem | CustomerSidebarLinkItem)[];
|
||||
}
|
||||
|
||||
export class CustomerLinksConfig {
|
||||
|
||||
Reference in New Issue
Block a user