Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 29 additions & 9 deletions app/client/src/api/ActionAPI.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -171,20 +171,28 @@ class ActionAPI extends API {
ActionAPI.apiUpdateCancelTokenSource.cancel();
}
ActionAPI.apiUpdateCancelTokenSource = axios.CancelToken.source();
const action: Partial<Action & { entityReferenceType: unknown }> = {
const payload: Partial<Action & { entityReferenceType: unknown }> = {
...apiConfig,
name: undefined,
entityReferenceType: undefined,
};
if (action.datasource != null) {
action.datasource = {
...(action as any).datasource,
actionConfiguration: apiConfig.actionConfiguration && {
...apiConfig.actionConfiguration,
autoGeneratedHeaders:
apiConfig.actionConfiguration.autoGeneratedHeaders?.map(
(header: any) => ({
...header,
isInvalid: undefined,
}),
) ?? undefined,
},
datasource: apiConfig.datasource && {
...(apiConfig as any).datasource,
datasourceStorages: undefined,
isValid: undefined,
new: undefined,
};
}
return API.put(`${ActionAPI.url}/${action.id}`, action, undefined, {
},
};
return API.put(`${ActionAPI.url}/${apiConfig.id}`, payload, undefined, {
cancelToken: ActionAPI.apiUpdateCancelTokenSource.token,
});
}
Expand Down Expand Up @@ -228,7 +236,19 @@ class ActionAPI extends API {
}

static async moveAction(moveRequest: MoveActionRequest) {
return API.put(ActionAPI.url + "/move", moveRequest, undefined, {
const payload = {
...moveRequest,
action: moveRequest.action && {
...moveRequest.action,
entityReferenceType: undefined,
datasource: moveRequest.action.datasource && {
...moveRequest.action.datasource,
isValid: undefined,
new: undefined,
},
},
};
return API.put(ActionAPI.url + "/move", payload, undefined, {
timeout: DEFAULT_EXECUTE_ACTION_TIMEOUT_MS,
});
}
Expand Down
6 changes: 5 additions & 1 deletion app/client/src/api/AppThemingApi.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,13 @@ class AppThemingApi extends API {
applicationId: string,
theme: AppTheme,
): Promise<AxiosPromise<ApiResponse<AppTheme[]>>> {
const payload = {
...theme,
new: undefined,
};
return API.put(
`${AppThemingApi.baseUrl}/themes/applications/${applicationId}`,
theme,
payload,
);
}

Expand Down
8 changes: 6 additions & 2 deletions app/client/src/api/PageApi.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -262,10 +262,14 @@ class PageApi extends Api {
static async generateTemplatePage(
request: GenerateTemplatePageRequest,
): Promise<AxiosPromise<ApiResponse>> {
const payload = {
...request,
pageId: undefined,
};
if (request.pageId) {
return Api.put(PageApi.getGenerateTemplateURL(request.pageId), request);
return Api.put(PageApi.getGenerateTemplateURL(request.pageId), payload);
} else {
return Api.post(PageApi.getGenerateTemplateURL(), request);
return Api.post(PageApi.getGenerateTemplateURL(), payload);
}
}

Expand Down