mirror of
https://github.com/outline/outline.git
synced 2026-06-13 11:25:03 +03:00
tsc
This commit is contained in:
@@ -245,6 +245,7 @@ async function provisionFirstCollection(team: Team, user: User) {
|
||||
document.content = await DocumentHelper.toJSON(document);
|
||||
|
||||
await document.publish(user, collection.id, {
|
||||
silent: true,
|
||||
transaction,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -361,7 +361,7 @@ class Document extends ParanoidModel<
|
||||
@BeforeSave
|
||||
static async updateCollectionStructure(
|
||||
model: Document,
|
||||
{ transaction }: SaveOptions<Document>
|
||||
{ transaction }: SaveOptions<InferAttributes<Document>>
|
||||
) {
|
||||
// templates, drafts, and archived documents don't appear in the structure
|
||||
// and so never need to be updated when the title changes
|
||||
@@ -811,8 +811,8 @@ class Document extends ParanoidModel<
|
||||
publish = async (
|
||||
user: User,
|
||||
collectionId: string,
|
||||
options: SaveOptions<Document>
|
||||
) => {
|
||||
options: SaveOptions
|
||||
): Promise<this> => {
|
||||
const { transaction } = options;
|
||||
|
||||
// If the document is already published then calling publish should act like
|
||||
|
||||
@@ -77,7 +77,10 @@ class Event extends IdModel<
|
||||
}
|
||||
|
||||
@AfterSave
|
||||
static async enqueue(model: Event, options: SaveOptions<Event>) {
|
||||
static async enqueue(
|
||||
model: Event,
|
||||
options: SaveOptions<InferAttributes<Event>>
|
||||
) {
|
||||
if (options.transaction) {
|
||||
options.transaction.afterCommit(() => void globalEventQueue.add(model));
|
||||
return;
|
||||
|
||||
@@ -177,7 +177,7 @@ class Notification extends Model<
|
||||
@AfterCreate
|
||||
static async createEvent(
|
||||
model: Notification,
|
||||
options: SaveOptions<Notification>
|
||||
options: SaveOptions<InferAttributes<Notification>>
|
||||
) {
|
||||
const params = {
|
||||
name: "notifications.create",
|
||||
|
||||
Reference in New Issue
Block a user