Skip to content

Commit dcbe4c6

Browse files
committed
fix: can't rely on this in onFulfilled when using confirmInvoke
1 parent 263541c commit dcbe4c6

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
- Fix `ViewModel.$load` and `ListViewModel.$load` not properly working with `.useResponseCaching()`.
77
- Entities that own multiple one-to-one relationships should no longer throw errors when generating.
88
- Don't duplicate data source parameters in OpenAPI parameter collections.
9+
- Fix error `this._removeFromParentCollection is not a function` thrown when calling `ViewModel.$delete.confirmInvoke()`.
910

1011
# 5.3.1
1112

src/coalesce-vue/src/api-client.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,7 @@ export const AxiosClient = axios.create();
435435
AxiosClient.defaults.baseURL = "/api";
436436
AxiosClient.defaults.paramsSerializer = (p) => objectToQueryString(p, false);
437437

438-
// Set X-Requested-With: XmlHttpRequest to prevent aspnetcore from serving HTML and redirects to API requests.
438+
// Set X-Requested-With: XMLHttpRequest to prevent aspnetcore from serving HTML and redirects to API requests.
439439
// https://github.com/dotnet/aspnetcore/blob/c440ebcf49badd49f0e2cdde1b0a74992af04158/src/Security/Authentication/Cookies/src/CookieAuthenticationEvents.cs#L107-L111
440440
AxiosClient.interceptors.request.use((config) => {
441441
const url = (config.baseURL ?? "") + (config.url ?? "");

src/coalesce-vue/src/viewmodel.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -546,7 +546,7 @@ export abstract class ViewModel<
546546
throw e;
547547
}
548548
})
549-
.onFulfilled(function (this: ViewModel) {
549+
.onFulfilled(() => {
550550
if (!this.$save.result) {
551551
// Can't do anything useful if the save returned no data.
552552
return;
@@ -999,7 +999,7 @@ export abstract class ViewModel<
999999
this._removeFromParentCollection();
10001000
}
10011001
})
1002-
.onFulfilled(function (this: ViewModel) {
1002+
.onFulfilled(() => {
10031003
this._removeFromParentCollection();
10041004
});
10051005

0 commit comments

Comments
 (0)