Skip to content

Commit

Permalink
Standardize logs meta field to use userId (#2248)
Browse files Browse the repository at this point in the history
* chore : fix logs meta field to use userId

* chore: fix task log
  • Loading branch information
vinit717 authored Dec 5, 2024
1 parent 5228100 commit daed096
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion controllers/extensionRequests.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ const createTaskExtensionRequest = async (req, res) => {
type: "extensionRequests",
meta: {
taskId: extensionBody.taskId,
createdBy: req.userData.id,
userId: req.userData.id,
},
body: {
extensionRequestId: extensionRequest.id,
Expand Down
2 changes: 1 addition & 1 deletion controllers/extensionRequestsv2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export const createTaskExtensionRequest = async (req: ExtensionRequestRequest, r
taskId,
requestId: extensionRequest.id,
action: LOG_ACTION.CREATE,
createdBy: requestedBy,
userId: requestedBy,
createdAt: Date.now(),
},
body: extensionBody,
Expand Down
2 changes: 1 addition & 1 deletion controllers/invites.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export const createInviteLink = async (req: InviteBodyRequest, res: CustomRespon
type: logType.DISCORD_INVITES,
meta: {
action: "create",
createdBy: logType.EXTERNAL_SERVICE,
userId: logType.EXTERNAL_SERVICE,
createdAt: Date.now(),
},
body: {
Expand Down
4 changes: 2 additions & 2 deletions controllers/oooRequests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export const createOooRequestController = async (req: OooRequestCreateRequest, r
meta: {
requestId: requestResult.id,
action: LOG_ACTION.CREATE,
createdBy: userId,
userId: userId,
createdAt: Date.now(),
},
body: requestResult,
Expand Down Expand Up @@ -84,7 +84,7 @@ export const updateOooRequestController = async (req: UpdateRequest, res: Custom
meta: {
requestId: requestId,
action: LOG_ACTION.UPDATE,
createdBy: userId,
userId: userId,
createdAt: Date.now(),
},
body: requestResult,
Expand Down
4 changes: 2 additions & 2 deletions controllers/taskRequestsv2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ export const createTaskRequestController = async (req: TaskRequestRequest, res:
meta: {
taskRequestId: updatedRequest.id,
action: "update",
createdBy: req.userData.id,
userId: req.userData.id,
createdAt: Date.now(),
lastModifiedBy: req.userData.id,
lastModifiedAt: Date.now(),
Expand Down Expand Up @@ -150,7 +150,7 @@ export const createTaskRequestController = async (req: TaskRequestRequest, res:
meta: {
taskRequestId: newTaskRequest.id,
action: "create",
createdBy: req.userData.id,
userId: req.userData.id,
createdAt: Date.now(),
lastModifiedBy: req.userData.id,
lastModifiedAt: Date.now(),
Expand Down
4 changes: 2 additions & 2 deletions controllers/tasksRequests.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ const addTaskRequests = async (req, res) => {
meta: {
taskRequestId: newTaskRequest.id,
action: "create",
createdBy: req.userData.id,
userId: req.userData.id,
createdAt: Date.now(),
lastModifiedBy: req.userData.id,
lastModifiedAt: Date.now(),
Expand Down Expand Up @@ -206,7 +206,7 @@ const updateTaskRequests = async (req, res) => {
taskRequestId: taskRequestId,
action: "update",
subAction: action,
createdBy: req.userData.id,
userId: req.userData.id,
createdAt: Date.now(),
lastModifiedBy: req.userData.id,
lastModifiedAt: Date.now(),
Expand Down

0 comments on commit daed096

Please sign in to comment.