fix: Views should be recorded for drafts closes #2862
This commit is contained in:
@@ -276,7 +276,7 @@ export default class Document extends BaseModel {
|
|||||||
@action
|
@action
|
||||||
view = () => {
|
view = () => {
|
||||||
// we don't record views for documents in the trash
|
// we don't record views for documents in the trash
|
||||||
if (this.isDeleted || !this.publishedAt) {
|
if (this.isDeleted) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -38,8 +38,7 @@ View.increment = async (where) => {
|
|||||||
return model;
|
return model;
|
||||||
};
|
};
|
||||||
|
|
||||||
// @ts-expect-error ts-migrate(7006) FIXME: Parameter 'documentId' implicitly has an 'any' typ... Remove this comment to see the full error message
|
View.findByDocument = async (documentId: string) => {
|
||||||
View.findByDocument = async (documentId) => {
|
|
||||||
return View.findAll({
|
return View.findAll({
|
||||||
where: {
|
where: {
|
||||||
documentId,
|
documentId,
|
||||||
@@ -54,8 +53,7 @@ View.findByDocument = async (documentId) => {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
// @ts-expect-error ts-migrate(7006) FIXME: Parameter 'documentId' implicitly has an 'any' typ... Remove this comment to see the full error message
|
View.findRecentlyEditingByDocument = async (documentId: string) => {
|
||||||
View.findRecentlyEditingByDocument = async (documentId) => {
|
|
||||||
return View.findAll({
|
return View.findAll({
|
||||||
where: {
|
where: {
|
||||||
documentId,
|
documentId,
|
||||||
|
|||||||
Reference in New Issue
Block a user