Skip to content

Commit

Permalink
feat(logging): adding logging (#1089)
Browse files Browse the repository at this point in the history
* feat(logging): adding logging

* fix(collaborator): typo
  • Loading branch information
kishore03109 authored Jan 2, 2024
1 parent b17525b commit a9671ee
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/routes/v2/authenticated/collaborators.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { attachReadRouteHandlerWrapper } from "@middleware/routeHandler"
import UserWithSiteSessionData from "@classes/UserWithSiteSessionData"

import { BaseIsomerError } from "@root/errors/BaseError"
import logger from "@root/logger/logger"
import { attachSiteHandler } from "@root/middleware"
import { RequestHandler } from "@root/types"
import { UserDto } from "@root/types/dto/review"
Expand Down Expand Up @@ -42,6 +43,10 @@ export class CollaboratorsRouter {
> = async (req, res) => {
const { email, acknowledge = false } = req.body
const { siteName } = req.params
const { userWithSiteSessionData } = res.locals
logger.info(
`Editing site members table by creating collaborator ${email} for site ${siteName} by user ${userWithSiteSessionData.isomerUserId}`
)
const resp = await this.collaboratorsService.create(
siteName,
email,
Expand All @@ -63,6 +68,11 @@ export class CollaboratorsRouter {
{ userWithSiteSessionData: UserWithSiteSessionData }
> = async (req, res) => {
const { siteName, userId } = req.params
const { userWithSiteSessionData } = res.locals
logger.info(
`Editing site members table by deleting collaborator ${userId} for site ${siteName} by user ${userWithSiteSessionData.isomerUserId}`
)

const resp = await this.collaboratorsService.delete(siteName, userId)

// Check for error and throw
Expand Down

0 comments on commit a9671ee

Please sign in to comment.