Page Menu
Home
Sealhub
Search
Configure Global Search
Log In
Files
F969457
index.ts
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
611 B
Referenced Files
None
Subscribers
None
index.ts
View Options
import
{
Middlewares
}
from
"sealious"
;
import
{
MainView
}
from
".."
;
import
{
router
}
from
"../.."
;
router
.
post
(
"/tasks"
,
Middlewares
.
extractContext
(),
Middlewares
.
parseBody
(),
async
(
ctx
)
=>
{
await
ctx
.
$app
.
collections
.
tasks
.
make
({
title
:
ctx
.
$body
.
title
as
string
,
done
:
false
,
})
.
save
(
ctx
.
$context
);
ctx
.
body
=
MainView
(
ctx
);
}
);
router
.
delete
(
"/tasks/:task_id"
,
Middlewares
.
extractContext
(),
async
(
ctx
)
=>
{
const
task
=
await
ctx
.
$app
.
collections
.
tasks
.
getByID
(
ctx
.
$context
,
ctx
.
params
.
task_id
);
await
task
.
remove
(
ctx
.
$context
);
ctx
.
body
=
MainView
(
ctx
);
});
File Metadata
Details
Attached
Mime Type
text/x-java
Expires
Sat, Nov 23, 02:59 (1 d, 12 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
547801
Default Alt Text
index.ts (611 B)
Attached To
Mode
rPLAY Sealious playground
Attached
Detach File
Event Timeline
Log In to Comment