Commit 4b229b7d authored by André Luís's avatar André Luís

Don't send custom msg in suggestion when disabled

When the feature flag is off, the frontend should not
send any different parameter to the api
parent ac431f2b
......@@ -442,10 +442,11 @@ const Api = {
});
},
applySuggestion(id, message) {
applySuggestion(id, message = '') {
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) {
......
......@@ -88,7 +88,12 @@ export default {
applySuggestion(message) {
if (!this.canApply) return;
this.isApplyingSingle = true;
this.$emit('apply', this.applySuggestionCallback, message);
this.$emit(
'apply',
this.applySuggestionCallback,
gon.features?.suggestionsCustomCommit ? message : undefined,
);
},
applySuggestionCallback() {
this.isApplyingSingle = false;
......
---
title: Fix bad request error when applying suggestions
merge_request:
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