cityssm/attendance-tracking

View on GitHub
database/removeFavouriteCallOutList.ts

Summary

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

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

export async function removeFavouriteCallOutList(
  listId: string,
  sessionUser: AttendUser
): Promise<boolean> {
  const pool = await sqlPoolConnect(getConfigProperty('mssql'))

  await pool
    .request()
    .input('userName', sessionUser.userName)
    .input('listId', listId).query(`delete from MonTY.FavouriteCallOutLists
      where userName = @userName
      and listId = @listId`)

  return true
}