@opengis/fastify-table
Version:
core-plugins
19 lines (18 loc) • 559 B
JavaScript
import pgClients from "../pg/pgClients.js";
import dataInsert from "../crud/funcs/dataInsert.js";
export default async function addUserNotification({ subject, body, link, addressee, author, entity, type, pg = pgClients.client, }) {
const res = await dataInsert({
pg,
table: "crm.notifications",
data: {
subject,
body,
link,
addressee_id: addressee,
author_id: author,
entity_id: entity,
type,
},
});
return res?.rows?.[0] || {};
}