Commit 1cfeeb1f authored by Mateus Haas's avatar Mateus Haas
Browse files

#73 Modificar nomenclaturas para anonymous.

parent e658b5ae
Showing with 6 additions and 6 deletions
+6 -6
......@@ -18,14 +18,14 @@ export default class Entity {
return adapter.fetchAll();
}
fetchAllReduced() {
fetchAllAnonymous() {
const adapter = new this.Adapter();
return new Promise((resolve, rjct) => {
//Retorna entidades do banco de dados
let body = adapter.fetchAll().then(body => {
//Para cada entidade, reduzir a quantidade das informações
return body.map(this._createNewReducedDTO);
return body.map(this._createNewAnonymousDTO);
});
return resolve(body);
......@@ -33,7 +33,7 @@ export default class Entity {
}
//Cria "DTO" com valores reduzidos
_createNewReducedDTO(entity) {
_createNewAnonymousDTO(entity) {
//Transforma nome em somente iniciais
entity.nome = StringHelper.getOnlyNameInitials(entity.nome);
......
......@@ -17,9 +17,9 @@ export default class Interactor {
return entity.fetchAll();
}
fetchAllReduced() {
fetchAllAnonymous() {
const entity = new this.Entity();
return entity.fetchAllReduced();
return entity.fetchAllAnonymous();
}
fetchById(id) {
......
......@@ -32,7 +32,7 @@ export default class Translator {
//Validar se a requisição atual possui escopo Anônimo
if (request.authInfo.scope === Roles.ANONYMOUS)
interactorResult = interactor.fetchAllReduced();
interactorResult = interactor.fetchAllAnonymous();
//Ou se possui escopo de Usuário/Admin
else
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment