1
0
Fork 0
mirror of synced 2024-06-15 00:44:41 +12:00
budibase/packages/backend-core/src/events/publishers/rows.ts
2022-06-01 14:44:12 +01:00

31 lines
635 B
TypeScript

import { publishEvent } from "../events"
import {
Event,
RowsImportedEvent,
RowsCreatedEvent,
RowImportFormat,
Table,
} from "@budibase/types"
/* eslint-disable */
export const created = async (count: number, timestamp?: string | number) => {
const properties: RowsCreatedEvent = {
count,
}
await publishEvent(Event.ROWS_CREATED, properties, timestamp)
}
export const imported = async (
table: Table,
format: RowImportFormat,
count: number
) => {
const properties: RowsImportedEvent = {
tableId: table._id as string,
format,
count,
}
await publishEvent(Event.ROWS_IMPORTED, properties)
}