Skip to content

Commit 3b31eea

Browse files
committed
refactor(user): update context value for command and query
1 parent 14c44cb commit 3b31eea

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

bin/modules/user/services/commands/command_domain.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class User {
1414
}
1515

1616
async registerUser(payload) {
17-
const ctx = 'cmd-domain-registerUser';
17+
const ctx = 'cmd-domain_registerUser';
1818
let { email, password } = payload;
1919
const checkUser = await this.query.getUserByEmail(email);
2020
if(checkUser.err && checkUser.err.message != 'Data not found') return checkUser;
@@ -31,7 +31,7 @@ class User {
3131
}
3232

3333
async authUser(payload) {
34-
const ctx = 'cmd-domain-authUser';
34+
const ctx = 'cmd-domain_authUser';
3535
let { email, password } = payload;
3636
const checkUser = await this.query.getUserByEmail(email);
3737
if(checkUser.err) {

bin/modules/user/services/commands/command_repository.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class CommandRepository {
1212
}
1313

1414
async getDB() {
15-
const ctx = 'cmd-repo-getDB';
15+
const ctx = 'cmd-repo_getDB';
1616
try {
1717
const {data: { connection: cacheConnection, dbName }} = await mongodbConn.fetchConnection(this.config);
1818
return wrapper.data(cacheConnection.db(dbName).collection(this.collectionName));
@@ -23,7 +23,7 @@ class CommandRepository {
2323
};
2424

2525
async addUser(email, password) {
26-
const ctx = 'cmd-repo-addUser';
26+
const ctx = 'cmd-repo_addUser';
2727
try {
2828
const { data:db } = await this.getDB();
2929
const document = {

bin/modules/user/services/queries/query_repository.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class QueryRepository {
1111
}
1212

1313
async getDB() {
14-
const ctx = 'cmd-repo-getDB';
14+
const ctx = 'qry-repo_getDB';
1515
try {
1616
const {data: { connection: cacheConnection, dbName }} = await mongodbConn.fetchConnection(this.config);
1717
return wrapper.data(cacheConnection.db(dbName).collection(this.collectionName));
@@ -22,7 +22,7 @@ class QueryRepository {
2222
};
2323

2424
async getUserByEmail(email) {
25-
const ctx = 'qry-repo-getUserByEmail';
25+
const ctx = 'qry-repo_getUserByEmail';
2626
try {
2727
const { data: db } = await this.getDB();
2828
const parameter = { email: email };

0 commit comments

Comments
 (0)