Skip to content

Commit 90eec96

Browse files
author
Gutierrez, Andres
committed
Add loggin in device resource
1 parent bb1606a commit 90eec96

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/resolvers/device/mutations.js

+8-4
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ const updateDevice = async (_, args, { loaders }) => {
1818
logger.info("Executing MUTATION| UpdateDevice");
1919
const { deviceId, name, port, agentDb } = args;
2020
await dal.updateDevice(deviceId, name, port, agentDb);
21-
const deviceObj = await dal.searchOneDevice(deviceId);
22-
await loaders.devices.prime(deviceId, deviceObj[0]);
21+
await loaders.devices.clear(args.deviceId);
22+
await loaders.devices.load(args.deviceId);
2323
return true;
2424
};
2525

@@ -33,7 +33,9 @@ const removeDevice = async (_, args, { loaders }) => {
3333

3434
const startSimulation = async (_, { deviceId }) => {
3535
logger.info("Executing MUTATION| startSimulation");
36-
return await grpcStartSimulation(deviceId);
36+
const response = await grpcStartSimulation(deviceId);
37+
logger.info(`Resolved response [${response}]`);
38+
return response;
3739
};
3840

3941
const stopSimulation = async (_, { deviceId }) => {
@@ -43,7 +45,9 @@ const stopSimulation = async (_, { deviceId }) => {
4345

4446
const fixAgentDb = async (_, { agentDb }) => {
4547
logger.info("Executing MUTATION| fixAgent");
46-
return await grpcFixDbAgent(agentDb);
48+
const response = await grpcFixDbAgent(agentDb);
49+
logger.info(`Resolved response [${response}]`);
50+
return response;
4751
};
4852

4953
export default {

0 commit comments

Comments
 (0)