message: Fix deleteProjectNotification sql function
diff: @@ -32,23 +32,21 @@ const Sql /* : SqlObj */ = {
  .select('nt.*', 'pn.*', knex.raw('? as type', [type]))
  .toString();
  },
  - deleteProjectNotification: (
  - input /* : Object */,
  - ) => {
  - const { project, notificationType, notificationName } = input;
  -
  - const deleteQuery = knex('project_notification AS pn')
  - .joinRaw(
  - `LEFT JOIN notification_${notificationType} AS nt ON pn.nid = nt.id AND pn.type = ?`,
  - [notificationType],
  - )
  - .leftJoin('project AS p', 'pn.pid', '=', 'p.id');
  + deleteProjectNotification: (input /* : Object */) => {
  + const deleteQuery = knex.raw(
  + `DELETE pn
  + FROM project_notification as pn
  + LEFT JOIN :notificationTable: AS nt ON pn.nid = nt.id AND pn.type = :notificationType
  + LEFT JOIN project as p on pn.pid = p.id
  + WHERE p.name = :project
  + AND nt.name = :notificationName`,
  + {
  + ...input,
  + notificationTable: `notification_${input.notificationType}`,
  + },
  + );
  - return deleteQuery
  - .where('p.name', project)
  - .andWhere('nt.name', notificationName)
  - .del()
  - .toString();
  + return deleteQuery.toString();
  },
  selectProjectById: (input /* : Object */) =>
  knex('project')
  @@ -83,9 +81,7 @@ const Sql /* : SqlObj */ = {
  .update(patch)
  .toString();
  },
  - selectNotificationsByTypeByProjectId: (
  - input /* : Object */,
  - ) => {
  + selectNotificationsByTypeByProjectId: (input /* : Object */) => {
  const { type, pid } = input;
  const selectQuery = knex('project_notification AS pn').joinRaw(
  `JOIN notification_${type} AS nt ON pn.nid = nt.id AND pn.type = ?`,
  