add: questions timelines
This commit is contained in:
parent
5d53ceb09c
commit
063e33899e
22 changed files with 407 additions and 90 deletions
|
@ -69,7 +69,7 @@
|
|||
|
||||
<div class="flex gap-2">
|
||||
<button class="primary">{{ text "requests:label.answer" }}</button>
|
||||
<button class="red quaternary" onclick="remove_question('{{ question[0].id }}')">{{ text "general:action.delete" }}</button>
|
||||
<button class="red quaternary" onclick="trigger('me::remove_question', ['{{ question[0].id }}'])">{{ text "general:action.delete" }}</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
@ -121,27 +121,6 @@
|
|||
});
|
||||
}
|
||||
|
||||
async function remove_question(id) {
|
||||
if (
|
||||
!(await trigger("atto::confirm", [
|
||||
"Are you sure you want to do this?",
|
||||
]))
|
||||
) {
|
||||
return;
|
||||
}
|
||||
|
||||
fetch(`/api/v1/questions/${id}`, {
|
||||
method: "DELETE",
|
||||
})
|
||||
.then((res) => res.json())
|
||||
.then((res) => {
|
||||
trigger("atto::toast", [
|
||||
res.ok ? "success" : "error",
|
||||
res.message,
|
||||
]);
|
||||
});
|
||||
}
|
||||
|
||||
async function answer_question_from_form(e, answering) {
|
||||
e.preventDefault();
|
||||
await trigger("atto::debounce", ["posts::create"]);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue