mirror of
https://github.com/OneUptime/oneuptime
synced 2024-11-21 22:59:07 +00:00
feat: add note to alert type
This commit is contained in:
parent
09196f397e
commit
8590cfa4c0
@ -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();
|
||||
|
@ -671,28 +671,25 @@ class DatabaseService<TBaseModel extends BaseModel> extends BaseService {
|
||||
);
|
||||
}
|
||||
|
||||
let tenantId: ObjectID | undefined = createBy.props.tenantId;
|
||||
|
||||
if (!tenantId && this.getModel().getTenantColumn()) {
|
||||
tenantId = createBy.data.getValue<ObjectID>(
|
||||
this.getModel().getTenantColumn()!,
|
||||
);
|
||||
}
|
||||
|
||||
// hit workflow.;
|
||||
if (this.getModel().enableWorkflowOn?.create) {
|
||||
let tenantId: ObjectID | undefined = createBy.props.tenantId;
|
||||
if (this.getModel().enableWorkflowOn?.create && tenantId) {
|
||||
await this.onTriggerWorkflow(createBy.data.id!, tenantId, "on-create");
|
||||
}
|
||||
|
||||
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,
|
||||
);
|
||||
}
|
||||
if (tenantId) {
|
||||
await this.onTriggerRealtime(
|
||||
createBy.data.id!,
|
||||
tenantId,
|
||||
ModelEventType.Create,
|
||||
);
|
||||
}
|
||||
|
||||
return createBy.data;
|
||||
|
Loading…
Reference in New Issue
Block a user