minor cosmetics for user service

This commit is contained in:
Daniel
2022-03-31 09:39:45 +02:00
committed by Christian Georgi
parent 8cc09fde38
commit 959c07cee3
5 changed files with 14 additions and 22 deletions

View File

@@ -1,15 +1,14 @@
/**
* Exposes user information
*/
@requires : 'authenticated-user'
@requires: 'authenticated-user'
service UserService {
/**
* The current user
*/
@odata.singleton
entity Me {
ID : String;
@odata.singleton entity me {
id : String; // user id
locale : String;
tenant : String;
}

View File

@@ -1,11 +1,4 @@
const cds = require('@sap/cds');
const cds = require('@sap/cds')
module.exports = cds.service.impl((srv) => {
srv.on('READ', 'Me', ({ user }) => {
return {
ID: user.id,
locale: user.locale,
tenant: user.tenant,
};
});
});
srv.on('READ', 'me', ({ tenant, user, locale }) => ({ id: user.id, locale, tenant }))
})