Commit b72f79e1 authored by Kushal Pandya's avatar Kushal Pandya

Merge branch '300209-fix-suggestions-bad-request' into 'master'

Don't send custom message when applying MR suggestions if the feature is off

See merge request gitlab-org/gitlab!52735
parents 1cec26c7 4f5efb82
...@@ -442,10 +442,11 @@ const Api = { ...@@ -442,10 +442,11 @@ const Api = {
}); });
}, },
applySuggestion(id, message) { applySuggestion(id, message = '') {
const url = Api.buildUrl(Api.applySuggestionPath).replace(':id', encodeURIComponent(id)); const url = Api.buildUrl(Api.applySuggestionPath).replace(':id', encodeURIComponent(id));
const params = gon.features?.suggestionsCustomCommit ? { commit_message: message } : false;
return axios.put(url, { commit_message: message }); return axios.put(url, params);
}, },
applySuggestionBatch(ids) { applySuggestionBatch(ids) {
......
...@@ -88,7 +88,12 @@ export default { ...@@ -88,7 +88,12 @@ export default {
applySuggestion(message) { applySuggestion(message) {
if (!this.canApply) return; if (!this.canApply) return;
this.isApplyingSingle = true; this.isApplyingSingle = true;
this.$emit('apply', this.applySuggestionCallback, message);
this.$emit(
'apply',
this.applySuggestionCallback,
gon.features?.suggestionsCustomCommit ? message : undefined,
);
}, },
applySuggestionCallback() { applySuggestionCallback() {
this.isApplyingSingle = false; this.isApplyingSingle = false;
......
---
title: Fix bad request error when applying suggestions
merge_request: 52735
author:
type: fixed
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment