Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(logging): adding logging #1089

Merged
merged 2 commits into from
Jan 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading