Skip to content

Commit

Permalink
Fix assetId being discarded on first navigation
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-va committed Oct 30, 2024
1 parent c96cf94 commit 2953117
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 0 additions & 1 deletion apps/server-asset-sg/src/app.logger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ export class AppLogger implements LoggerService {
output += level.color(`${message}`);
}
if (params.length !== 0 && !(params.length === 1 && params[0] === undefined)) {
console.log({ params });
output += ' ' + stringify(params, level);
}
if (message instanceof Error) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,9 +205,10 @@ export class AssetSearchEffects {
concatLatestFrom(() => [
this.store.select(selectAssetSearchQuery),
this.store.select(selectCurrentAssetDetail),
this.queryParams$,
]),
switchMap(([_, query, assetDetail]) => {
const params: Params = { assetId: assetDetail?.assetId };
switchMap(([_, query, assetDetail, queryParams]) => {
const params: Params = { assetId: assetDetail?.assetId ?? queryParams.assetId };
updatePlainParam(params, QUERY_PARAM_MAPPING.text, query.text);
updateArrayParam(
params,
Expand All @@ -223,6 +224,7 @@ export class AssetSearchEffects {
updateArrayParam(params, QUERY_PARAM_MAPPING.geometryCodes, query.geometryCodes);
updateArrayParam(params, QUERY_PARAM_MAPPING.languageItemCodes, query.languageItemCodes);
updateArrayParam(params, QUERY_PARAM_MAPPING.workgroupIds, query.workgroupIds);
console.log({ params });
return this.router.navigate([], { queryParams: params });
})
),
Expand Down

0 comments on commit 2953117

Please sign in to comment.