fix(api): fix cache location in view counter endpoint
This commit is contained in:
parent
a96f924f1e
commit
1b891c6b2c
@ -4,7 +4,7 @@ import { Story } from "@models/stories";
|
|||||||
export default eventHandler(async (ev) => {
|
export default eventHandler(async (ev) => {
|
||||||
const id = isIdNan(ev);
|
const id = isIdNan(ev);
|
||||||
const ip = getRequestIP(ev, { xForwardedFor: true });
|
const ip = getRequestIP(ev, { xForwardedFor: true });
|
||||||
const storage = useStorage(`/story/${id}/viewMap`);
|
const storage = useStorage(`/stories/story/${id}/viewMap`);
|
||||||
if (ev.context.currentUser) {
|
if (ev.context.currentUser) {
|
||||||
if (!(await storage.hasItem(`loggedIn/${ev.context.currentUser._id}`))) {
|
if (!(await storage.hasItem(`loggedIn/${ev.context.currentUser._id}`))) {
|
||||||
await Story.findByIdAndUpdate(id, {
|
await Story.findByIdAndUpdate(id, {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user