cityssm/attendance-tracking

View on GitHub
database/clearUserPermissions.ts

Summary

Maintainability
A
0 mins
Test Coverage
import { connect as sqlPoolConnect } from '@cityssm/mssql-multi-pool'

import { getConfigProperty } from '../helpers/functions.config.js'

export async function clearUserPermissions(userName: string): Promise<boolean> {
  const pool = await sqlPoolConnect(getConfigProperty('mssql'))

  await pool.request().input('userName', userName)
    .query(`delete from MonTY.UserPermissions
      where userName = @userName`)

  return true
}