Skip to content

Commit

Permalink
feat: add note to alert type
Browse files Browse the repository at this point in the history
  • Loading branch information
simlarsen committed Oct 8, 2024
1 parent 09196f3 commit 8590cfa
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 21 deletions.
2 changes: 1 addition & 1 deletion Common/Server/Services/AlertStateTimelineService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ export class Service extends DatabaseService<AlertStateTimeline> {

const internalNote: string | undefined = (
createBy.miscDataProps as JSONObject | undefined
)?.["publicNote"] as string | undefined;
)?.["internalNote"] as string | undefined;

if (internalNote) {
const alertNote: AlertInternalNote = new AlertInternalNote();
Expand Down
37 changes: 17 additions & 20 deletions Common/Server/Services/DatabaseService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -671,28 +671,25 @@ class DatabaseService<TBaseModel extends BaseModel> extends BaseService {
);
}

// hit workflow.;
if (this.getModel().enableWorkflowOn?.create) {
let tenantId: ObjectID | undefined = createBy.props.tenantId;
let tenantId: ObjectID | undefined = createBy.props.tenantId;

if (!tenantId && this.getModel().getTenantColumn()) {
tenantId = createBy.data.getValue<ObjectID>(
this.getModel().getTenantColumn()!,
);
}
if (!tenantId && this.getModel().getTenantColumn()) {
tenantId = createBy.data.getValue<ObjectID>(
this.getModel().getTenantColumn()!,
);
}

if (tenantId) {
await this.onTriggerWorkflow(
createBy.data.id!,
tenantId,
"on-create",
);
await this.onTriggerRealtime(
createBy.data.id!,
tenantId,
ModelEventType.Create,
);
}
// hit workflow.;
if (this.getModel().enableWorkflowOn?.create && tenantId) {
await this.onTriggerWorkflow(createBy.data.id!, tenantId, "on-create");
}

if (tenantId) {
await this.onTriggerRealtime(
createBy.data.id!,
tenantId,
ModelEventType.Create,
);
}

return createBy.data;
Expand Down

0 comments on commit 8590cfa

Please sign in to comment.