mirror of
https://github.com/solidtime-io/solidtime.git
synced 2026-08-16 04:02:15 +01:00
add dashboard frontend
This commit is contained in:
17
resources/js/utils/useUser.ts
Normal file
17
resources/js/utils/useUser.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
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 getCurrentOrganizationId() {
|
||||
return page.props.auth.user.current_team_id;
|
||||
}
|
||||
|
||||
export { getCurrentOrganizationId, getCurrentUserId };
|
||||
Reference in New Issue
Block a user