Skip to content

Commit

Permalink
feat(com-pwa): add admin-order route
Browse files Browse the repository at this point in the history
  • Loading branch information
mohammadhonarvar committed May 29, 2023
1 parent bd431bf commit 7bb5ade
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions uniquely/com-pwa/src/ui/alwatr-pwa.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ class AlwatrPwa extends AlwatrPwaElement {
'_404': this._renderPage404,
'order-list': this._renderPageOrderList,
'admin-order-list': this._renderPageAdminOrderList,
'admin-order': this._renderPageAdminOrder,
'order': this._renderPageOrder,
'sign-in': this._renderPageSignIn,
's': this._saveLinkPass,
Expand Down Expand Up @@ -67,6 +68,17 @@ class AlwatrPwa extends AlwatrPwaElement {
return html`<alwatr-page-admin-order-list unresolved>...</alwatr-page-admin-order-list>`;
}

protected _renderPageAdminOrder(routeContext: RouteContext): unknown {
import('./page/admin-order.js');
topAppBarContextProvider.setValue({headlineKey: 'loading'});
return html`<alwatr-page-admin-order
.userId=${routeContext.sectionList[1]}
.orderId=${routeContext.sectionList[2]}
unresolved
>...</alwatr-page-admin-order
>`;
}

protected _renderPageOrder(routeContext: RouteContext): unknown {
import('./page/order.js');
topAppBarContextProvider.setValue({headlineKey: 'loading'});
Expand Down Expand Up @@ -101,11 +113,7 @@ class AlwatrPwa extends AlwatrPwaElement {
return;
}
// else
if (
routeId !== 'sign-in' &&
routeId !== 's' &&
routeId !== ''
) {
if (routeId !== 'sign-in' && routeId !== 's' && routeId !== '') {
redirect({sectionList: ['sign-in']});
}
}
Expand Down

0 comments on commit 7bb5ade

Please sign in to comment.