From 730da6e435d919a6ae10a25b7a608d97656e1ba0 Mon Sep 17 00:00:00 2001 From: Pierre Fritsch Date: Wed, 4 Aug 2021 13:58:21 +0200 Subject: [PATCH] hello TypeScript: Define type of `req` object Make it clearer that `req` is a CDS `Request` object. --- hello/srv/world.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hello/srv/world.ts b/hello/srv/world.ts index 21a63b46..898e38e0 100644 --- a/hello/srv/world.ts +++ b/hello/srv/world.ts @@ -1,5 +1,7 @@ +import { Request } from "@sap/cds/apis/services" + module.exports = class say { - hello(req: any) { + hello(req: Request) { return `Hello ${req.data.to} from a TypeScript file!` } }