зеркало из https://github.com/nextcloud/forms.git
Merge pull request #749 from nextcloud/fix/option_response
Make new option return similar to new question and form
This commit is contained in:
Коммит
79a1fde120
|
@ -622,9 +622,7 @@ class ApiController extends OCSController {
|
|||
|
||||
$option = $this->optionMapper->insert($option);
|
||||
|
||||
return new DataResponse([
|
||||
'id' => $option->getId()
|
||||
]);
|
||||
return new DataResponse($option->read());
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -147,7 +147,7 @@ export default {
|
|||
async createAnswer(answer) {
|
||||
try {
|
||||
const response = await axios.post(generateOcsUrl('apps/forms/api/v1', 2) + 'option', {
|
||||
questionId: answer.question_id,
|
||||
questionId: answer.questionId,
|
||||
text: answer.text,
|
||||
})
|
||||
console.debug('Created answer', answer)
|
||||
|
|
|
@ -236,7 +236,7 @@ export default {
|
|||
const options = this.options.slice()
|
||||
options.push({
|
||||
id: GenRandomId(),
|
||||
question_id: this.id,
|
||||
questionId: this.id,
|
||||
text: '',
|
||||
local: true,
|
||||
})
|
||||
|
|
|
@ -243,7 +243,7 @@ export default {
|
|||
const options = this.options.slice()
|
||||
options.push({
|
||||
id: GenRandomId(),
|
||||
question_id: this.id,
|
||||
questionId: this.id,
|
||||
text: '',
|
||||
local: true,
|
||||
})
|
||||
|
|
Загрузка…
Ссылка в новой задаче