mirror of
https://github.com/outline/outline.git
synced 2026-11-28 16:19:46 +03:00
fix: shares.update written on every view, regressed in #8177
This commit is contained in:
1 parent
db30d080ae
commit
e93ef8b392
1 file changed
+9
-4
@@ -168,10 +168,15 @@ export const renderShare = async (ctx: Context, next: Next) => {
|
||||
});
|
||||
|
||||
if (share && !ctx.userAgent.isBot) {
|
||||
await share.update({
|
||||
lastAccessedAt: new Date(),
|
||||
views: Sequelize.literal("views + 1"),
|
||||
});
|
||||
await share.update(
|
||||
{
|
||||
lastAccessedAt: new Date(),
|
||||
views: Sequelize.literal("views + 1"),
|
||||
},
|
||||
{
|
||||
hooks: false,
|
||||
}
|
||||
);
|
||||
}
|
||||
} catch (err) {
|
||||
// If the share or document does not exist, return a 404.
|
||||
|
||||
Reference in new issue
Block a user