mirror of
https://github.com/outline/outline.git
synced 2026-11-21 13:34:02 +03:00
* fix: nested docs should appear in archive * fix(app): ArchivableModel * fix(server): ArchivableModel * fix: PartialWithArchivedAt not needed * fix: new PartialExcept type * fix: restore deletion * fix: review
26 lines
658 B
TypeScript
26 lines
658 B
TypeScript
/* eslint-disable @typescript-eslint/ban-types */
|
|
import { AllowNull, Column, IsDate } from "sequelize-typescript";
|
|
import ParanoidModel from "./ParanoidModel";
|
|
|
|
class ArchivableModel<
|
|
TModelAttributes extends {} = any,
|
|
TCreationAttributes extends {} = TModelAttributes
|
|
> extends ParanoidModel<TModelAttributes, TCreationAttributes> {
|
|
/** Whether the document is archived, and if so when. */
|
|
@AllowNull
|
|
@IsDate
|
|
@Column
|
|
archivedAt: Date | null;
|
|
|
|
/**
|
|
* Whether the model has been archived.
|
|
*
|
|
* @returns True if the model has been archived
|
|
*/
|
|
get isArchived() {
|
|
return !!this.archivedAt;
|
|
}
|
|
}
|
|
|
|
export default ArchivableModel;
|