Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 5 additions & 13 deletions ghost/core/core/server/services/automations/automations-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,11 @@ const repository = createFakeDatabaseAutomationsRepository({
}
});

async function browse() {
export async function browse() {
return await repository.browse();
}

async function read(automationId: string) {
export async function read(automationId: string) {
const automation = await repository.getById(automationId);

if (!automation) {
Expand All @@ -98,7 +98,7 @@ async function read(automationId: string) {
return automation;
}

async function edit(automationId: string, data: unknown) {
export async function edit(automationId: string, data: unknown) {
const parsedData = validateEditData(data);

const automation = await repository.edit(automationId, parsedData);
Expand Down Expand Up @@ -234,20 +234,12 @@ function throwValidationError(message: string, property?: string): never {
});
}

function requestPoll() {
export function requestPoll() {
domainEvents.dispatch(StartAutomationsPollEvent.create());
}

function _resetTestDatabase() {
export function _resetTestDatabase() {
if (process.env.NODE_ENV?.startsWith('testing')) {
testDatabase = null;
}
}

module.exports = {
_resetTestDatabase,
browse,
edit,
read,
requestPoll
};
Loading