mirror of
https://github.com/usatiuk/writer.git
synced 2025-10-29 00:17:48 +01:00
fix request typing in tests
This commit is contained in:
@@ -12,7 +12,7 @@ docsRouter.post("/docs/new", async ctx => {
|
||||
|
||||
const { user } = ctx.state;
|
||||
|
||||
const { name, content } = ctx.request.body as {
|
||||
const { name, content } = (ctx.request as any).body as {
|
||||
name: string | undefined;
|
||||
content: string | undefined;
|
||||
};
|
||||
@@ -54,7 +54,7 @@ docsRouter.patch("/docs/byID/:id", async ctx => {
|
||||
ctx.throw(400);
|
||||
}
|
||||
|
||||
const { name, content } = ctx.request.body as {
|
||||
const { name, content } = (ctx.request as any).body as {
|
||||
name: string | undefined;
|
||||
content: string | undefined;
|
||||
};
|
||||
|
||||
@@ -16,7 +16,7 @@ userRouter.get("/users/user", async ctx => {
|
||||
});
|
||||
|
||||
userRouter.post("/users/login", async ctx => {
|
||||
const request = ctx.request;
|
||||
const request = ctx.request as any;
|
||||
|
||||
if (!request.body) {
|
||||
ctx.throw(400);
|
||||
@@ -39,7 +39,7 @@ userRouter.post("/users/login", async ctx => {
|
||||
});
|
||||
|
||||
userRouter.post("/users/signup", async ctx => {
|
||||
const request = ctx.request;
|
||||
const request = ctx.request as any;
|
||||
|
||||
if (!request.body) {
|
||||
ctx.throw(400);
|
||||
|
||||
Reference in New Issue
Block a user