From 7a30c41529c1d3ee2b40896a55c28ddbae4aa14e Mon Sep 17 00:00:00 2001 From: vincanger <70215737+vincanger@users.noreply.github.com> Date: Thu, 13 Feb 2025 13:19:37 +0100 Subject: [PATCH] change func name --- template/app/main.wasp | 4 ++-- template/app/src/client/App.tsx | 4 ++-- template/app/src/user/operations.ts | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/template/app/main.wasp b/template/app/main.wasp index 2cb2c7c..657e9f0 100644 --- a/template/app/main.wasp +++ b/template/app/main.wasp @@ -140,8 +140,8 @@ query getPaginatedUsers { entities: [User] } -action updateCurrentUser { - fn: import { updateCurrentUser } from "@src/user/operations", +action updateCurrentUserLastActiveTimestamp { + fn: import { updateCurrentUserLastActiveTimestamp } from "@src/user/operations", entities: [User] } diff --git a/template/app/src/client/App.tsx b/template/app/src/client/App.tsx index ead2651..65dd8fa 100644 --- a/template/app/src/client/App.tsx +++ b/template/app/src/client/App.tsx @@ -8,7 +8,7 @@ import { routes } from 'wasp/client/router'; import { Outlet, useLocation } from 'react-router-dom'; import { useAuth } from 'wasp/client/auth'; import { useIsLandingPage } from './hooks/useIsLandingPage'; -import { updateCurrentUser } from 'wasp/client/operations'; +import { updateCurrentUserLastActiveTimestamp } from 'wasp/client/operations'; /** * use this component to wrap all child components @@ -33,7 +33,7 @@ export default function App() { const lastSeenAt = new Date(user.lastActiveTimestamp); const today = new Date(); if (today.getTime() - lastSeenAt.getTime() > 5 * 60 * 1000) { - updateCurrentUser({ lastActiveTimestamp: today }); + updateCurrentUserLastActiveTimestamp({ lastActiveTimestamp: today }); } } }, [user]); diff --git a/template/app/src/user/operations.ts b/template/app/src/user/operations.ts index d74b20c..eef1f7f 100644 --- a/template/app/src/user/operations.ts +++ b/template/app/src/user/operations.ts @@ -1,5 +1,5 @@ import { - type UpdateCurrentUser, + type UpdateCurrentUserLastActiveTimestamp, type UpdateUserById, type GetPaginatedUsers, } from 'wasp/server/operations'; @@ -29,7 +29,7 @@ export const updateUserById: UpdateUserById<{ id: string; data: Partial }, return updatedUser; }; -export const updateCurrentUser: UpdateCurrentUser, User> = async ({ lastActiveTimestamp }, context) => { +export const updateCurrentUserLastActiveTimestamp: UpdateCurrentUserLastActiveTimestamp, User> = async ({ lastActiveTimestamp }, context) => { if (!context.user) { throw new HttpError(401); }