Files
solidtime/resources/js/utils/useUser.ts
2024-04-29 16:49:58 +02:00

31 lines
565 B
TypeScript

import { usePage } from '@inertiajs/vue3';
import type { User } from '@/types/models';
const page = usePage<{
auth: {
user: User;
};
}>();
function getCurrentUserId() {
return page.props.auth.user.id;
}
function getWeekStart() {
return page.props.auth.user.week_start;
}
function getCurrentOrganizationId() {
return page.props.auth.user.current_team_id;
}
function getUserTimezone() {
return page.props.auth.user.timezone;
}
export {
getCurrentOrganizationId,
getCurrentUserId,
getUserTimezone,
getWeekStart,
};