mirror of
https://github.com/DCsunset/taskwarrior-webui.git
synced 2025-08-24 15:06:40 +02:00
fix(backend): fix query parsing and deletion route
This commit is contained in:
parent
1a18ea3f8a
commit
61be60c091
4 changed files with 33 additions and 6 deletions
|
@ -1,14 +1,19 @@
|
|||
import * as Koa from 'koa';
|
||||
import * as Router from '@koa/router';
|
||||
import * as bodyParser from 'koa-bodyparser';
|
||||
import * as logger from 'koa-logger';
|
||||
import * as qs from 'koa-qs';
|
||||
|
||||
import tasksRouter from './tasks';
|
||||
|
||||
const app = new Koa();
|
||||
|
||||
qs(app);
|
||||
app.use(bodyParser());
|
||||
app.use(logger());
|
||||
|
||||
const router = new Router();
|
||||
router.use(tasksRouter.routes());
|
||||
router.use('/tasks', tasksRouter.routes());
|
||||
|
||||
app.use(router.routes());
|
||||
app.use(router.allowedMethods());
|
||||
|
|
|
@ -22,12 +22,9 @@ router.put('/', async ctx => {
|
|||
});
|
||||
|
||||
router.delete('/', async ctx => {
|
||||
const tasks = ctx.query.tasks;
|
||||
console.log(tasks);
|
||||
/*
|
||||
const msg = taskwarrior.update(tasks);
|
||||
const tasks = ctx.query.tasks as string[];
|
||||
const msg = taskwarrior.del(tasks.map(t => ({ uuid: t })));
|
||||
console.log(msg);
|
||||
*/
|
||||
ctx.status = 200;
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue