Skip to content

Commit

Permalink
feat(keep-pwa): update config
Browse files Browse the repository at this point in the history
  • Loading branch information
njfamirm committed May 31, 2023
1 parent cf23cd1 commit 8947663
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 10 deletions.
14 changes: 8 additions & 6 deletions uniquely/keep-pwa/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,17 @@ import {getLocalStorageItem} from '@alwatr/util';
* ```
*/
const srvBaseUrl = getLocalStorageItem('DEBUG_API', '/');
const apiBaseUrl = srvBaseUrl + 'api/v1/';
const apiBaseUrl = srvBaseUrl + 'api/v0/';

export const config = {
base: srvBaseUrl,
api: apiBaseUrl,
cdn: apiBaseUrl + 'cdn',
token: getConfKey<string>('token'),
serverContext: {
base: srvBaseUrl,
api: apiBaseUrl,
cdn: apiBaseUrl + 'cdn',
token: getConfKey<string>('token'),
},

fetchContextOptions: <Partial<FetchOptions>>{
method: 'GET',
removeDuplicate: 'auto',
retry: 2,
retryDelay: 2_000,
Expand Down
4 changes: 2 additions & 2 deletions uniquely/keep-pwa/src/manager/submit-form-command-handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@ commandHandler.define<FormData, boolean>(submitFormCommandTrigger.id, async (for
try {
await serviceRequest({
method: 'PUT',
url: config.api + 'form/',
url: config.serverContext.api + 'form/',
queryParameters: {
formId: form.formId,
},
token: config.token,
token: config.serverContext.token,
bodyJson,
});
}
Expand Down
5 changes: 3 additions & 2 deletions uniquely/keep-pwa/src/ui/page/404.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
import {message} from '@alwatr/i18n';
import '@alwatr/ui-kit/card/icon-box.js';

import {topAppBarContextProvider} from '../../manager/context.js';
import {languageButtonClickEventListener, topAppBarContextProvider} from '../../manager/context.js';

import type {IconBoxContent} from '@alwatr/ui-kit/card/icon-box.js';

Expand Down Expand Up @@ -38,8 +38,9 @@ export class AlwatrPage404 extends UnresolvedMixin(LocalizeMixin(SignalMixin(Alw
super.connectedCallback();
topAppBarContextProvider.setValue({
type: 'small',
headline: message('page_404_not_found'),
headlineKey: 'page_404_not_found',
startIcon: {icon: 'arrow-back-outline', flipRtl: true, clickSignalId: 'back_to_home_click_event'},
endIconList: [{icon: 'globe-outline', clickSignalId: languageButtonClickEventListener.id}],
tinted: 2,
});
}
Expand Down

0 comments on commit 8947663

Please sign in to comment.