This commit is contained in:
Xeltica 2020-07-24 14:18:17 +09:00
parent a4c54edb54
commit 9cc01202e4
2 changed files with 6 additions and 1 deletions

View File

@ -228,11 +228,12 @@ router.post('/action/:action', async ctx => {
try {
switch (action) {
case 'create-note': {
const { text, renoteId, replyId } = ctx.request.body;
const { text, renoteId, replyId, useCw, cw } = ctx.request.body;
const opts = { i } as Record<string, string>;
if (text) opts.text = text;
if (renoteId) opts.renoteId = renoteId;
if (replyId) opts.replyId = replyId;
if (useCw) opts.cw = cw || '';
await api(host, 'notes/create', opts);
break;
}

View File

@ -79,6 +79,10 @@ mixin note(note)
mixin post-form(url, placeholder, buttonText)
form(action=url, method="post")
div: label
input(type="checkbox", name="useCw")
span CW
input(type="text", name="cw" placeholder="注釈(省略可能)" style="max-width: 100%; min-width: 100%;")
textarea(name="text", placeholder=placeholder style="max-width: 100%; min-width: 100%; height: 6em; margin-bottom: 8px")
button(type="submit")= buttonText
block