chore: clean up events
This commit is contained in:
@ -895,8 +895,6 @@ export class Backend<EF extends BaseField = UnknownField, BC extends BackendClas
|
||||
...updatedOptions,
|
||||
};
|
||||
|
||||
await this.invokePrePublishEvent(entryDraft.entry);
|
||||
|
||||
await this.implementation.persistEntry(
|
||||
{
|
||||
dataFiles,
|
||||
@ -906,7 +904,6 @@ export class Backend<EF extends BaseField = UnknownField, BC extends BackendClas
|
||||
);
|
||||
|
||||
await this.invokePostSaveEvent(entryDraft.entry);
|
||||
await this.invokePostPublishEvent(entryDraft.entry);
|
||||
|
||||
return slug;
|
||||
}
|
||||
@ -916,14 +913,6 @@ export class Backend<EF extends BaseField = UnknownField, BC extends BackendClas
|
||||
return await invokeEvent({ name: event, data: { entry, author: { login, name } } });
|
||||
}
|
||||
|
||||
async invokePrePublishEvent(entry: Entry) {
|
||||
await this.invokeEventWithEntry('prePublish', entry);
|
||||
}
|
||||
|
||||
async invokePostPublishEvent(entry: Entry) {
|
||||
await this.invokeEventWithEntry('postPublish', entry);
|
||||
}
|
||||
|
||||
async invokePreSaveEvent(entry: Entry) {
|
||||
return await this.invokeEventWithEntry('preSave', entry);
|
||||
}
|
||||
|
@ -26,7 +26,7 @@ import type {
|
||||
WidgetValueSerializer,
|
||||
} from '../interface';
|
||||
|
||||
export const allowedEvents = ['prePublish', 'postPublish', 'preSave', 'postSave'] as const;
|
||||
export const allowedEvents = ['preSave', 'postSave'] as const;
|
||||
export type AllowedEvent = (typeof allowedEvents)[number];
|
||||
|
||||
const eventHandlers = allowedEvents.reduce((acc, e) => {
|
||||
|
Reference in New Issue
Block a user