Skip to content

Commit

Permalink
fix: interaction between refResponse and simultaneousGetCaching
Browse files Browse the repository at this point in the history
  • Loading branch information
ascott18 committed Dec 3, 2024
1 parent 30391ca commit cb9dba5
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
10 changes: 10 additions & 0 deletions playground/Coalesce.Web.Vue3/src/components/test.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,16 @@
:params="{ refResponse: true }"
>
</c-select>
<c-select
:model="caseVm"
for="assignedTo"
variant="outlined"
density="compact"
class="my-4"
error-messages="sdfsdf"
:params="{ refResponse: true }"
>
</c-select>
</v-col>
<v-col>
<c-input
Expand Down
5 changes: 3 additions & 2 deletions src/coalesce-vue/src/api-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -769,6 +769,8 @@ export class ApiClient<T extends ApiRoutedType> {
: ["application/json"],
};
}
let cacheKey = JSON.stringify(headers);

const axiosRequest = <AxiosRequestConfig>{
method: method.httpMethod,
url: url,
Expand Down Expand Up @@ -797,14 +799,13 @@ export class ApiClient<T extends ApiRoutedType> {
}

let doCache = false;
let cacheKey: string;

if (
method.httpMethod === "GET" &&
this._simultaneousGetCaching &&
!config
) {
cacheKey = AxiosClient.getUri(axiosRequest);
cacheKey += "_" + AxiosClient.getUri(axiosRequest);
if (simultaneousGetCache.has(cacheKey)) {
return simultaneousGetCache.get(cacheKey) as any;
} else {
Expand Down

0 comments on commit cb9dba5

Please sign in to comment.