mirror of
https://github.com/outline/outline.git
synced 2026-11-21 13:34:02 +03:00
docs, saveWithCtx
This commit is contained in:
1 parent
18d25b0e0e
commit
a8391dfec0
2 files changed
+12
-1
No files matched your search
@@ -55,6 +55,7 @@ class Event extends IdModel<
|
||||
|
||||
/**
|
||||
* Metadata associated with the event, previously used for storing some changed attributes.
|
||||
* Note that the `data` column will be visible to the client and API requests.
|
||||
*/
|
||||
@Column(DataType.JSONB)
|
||||
data: Record<string, any> | null;
|
||||
|
||||
@@ -12,6 +12,7 @@ import {
|
||||
InstanceUpdateOptions,
|
||||
ModelStatic,
|
||||
NonAttribute,
|
||||
InstanceSaveOptions,
|
||||
} from "sequelize";
|
||||
import {
|
||||
AfterCreate,
|
||||
@@ -29,10 +30,19 @@ class Model<
|
||||
TCreationAttributes extends {} = TModelAttributes
|
||||
> extends SequelizeModel<TModelAttributes, TCreationAttributes> {
|
||||
/**
|
||||
* The namespace to use for events, if none is provided an event will not be created.
|
||||
* The namespace to use for events, if none is provided an event will not be created
|
||||
* during the migration period. In the future this may default to the table name.
|
||||
*/
|
||||
static eventNamespace: string | undefined;
|
||||
|
||||
/**
|
||||
* Validates this instance, and if the validation passes, persists it to the database.
|
||||
*/
|
||||
public saveWithCtx(ctx: APIContext) {
|
||||
this.cacheChangeset();
|
||||
return this.save(ctx.context as InstanceSaveOptions);
|
||||
}
|
||||
|
||||
/**
|
||||
* This is the same as calling `set` and then calling `save`.
|
||||
*/
|
||||
|
||||
Reference in new issue
Block a user