fix(api): fix cache location in view counter endpoint

This commit is contained in:
☙◦ The Tablet ❀ GamerGirlandCo ◦❧ 2024-11-11 18:45:49 -05:00
parent a96f924f1e
commit 1b891c6b2c
Signed by: tablet
GPG Key ID: 924A5F6AF051E87C

View File

@ -4,7 +4,7 @@ import { Story } from "@models/stories";
export default eventHandler(async (ev) => {
const id = isIdNan(ev);
const ip = getRequestIP(ev, { xForwardedFor: true });
const storage = useStorage(`/story/${id}/viewMap`);
const storage = useStorage(`/stories/story/${id}/viewMap`);
if (ev.context.currentUser) {
if (!(await storage.hasItem(`loggedIn/${ev.context.currentUser._id}`))) {
await Story.findByIdAndUpdate(id, {