on 10-07-2023 12:21 AM
Hello experts, I need to show my user a personalized message when he makes a post request to my service which is
At the moment I have this handler but when I do the test from postman it returns the same array that I sent and the post is completed
srv.on('CREATE', 'Clientes', async (req) => {
const result = await INSERT.into(req.target).entries(req.data);
if (result) {
return {
...req.data,
message: "Cliente creado exitosamente en ClientesRest"
};
} else {
return {
message: "Error al crear el cliente en ClientesRest"
};
}
});
I appreciate your help. Thank you so much
Hi Santiago,
Have you considered trying using methods req.notify(), req.info(), req.warn() & req.error() as a way to pass messages to the client?
Events and Requests | CAPire (cloud.sap)
The messages are passed into a response header "sap-messages" as an array.
Katan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
75 | |
9 | |
8 | |
7 | |
6 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.