feat: implement API composables for authentication and data fetching
- Add useApiFetch composable for HTTP requests with auth token - Implement useAuth composable for authentication endpoints - Add useAdmin composable for admin operations - Add useOperator composable for operator management - Add useMembers composable for member data - Add usePublic composable for public reports - Add useReports composable for report operations Co-authored-by: Copilot <[email protected]>
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
import { computed } from 'vue';
|
||||
|
||||
export interface Member {
|
||||
name: string;
|
||||
image: string;
|
||||
}
|
||||
|
||||
export function useMembers() {
|
||||
const members: Member[] = [
|
||||
{ name: "Renato Loiacono", image: "https://placehold.co/50x50" },
|
||||
{ name: "Michelangelo Parisi", image: "https://placehold.co/50x50" },
|
||||
{ name: "Gabriele Schiraldi", image: "https://placehold.co/50x50" },
|
||||
];
|
||||
|
||||
const sortedMembers = computed(() => {
|
||||
return [...members].sort((a, b) => {
|
||||
const aSurnameInitial = a.name.split(" ").pop()?.[0] ?? "";
|
||||
const bSurnameInitial = b.name.split(" ").pop()?.[0] ?? "";
|
||||
return aSurnameInitial.localeCompare(bSurnameInitial);
|
||||
});
|
||||
});
|
||||
|
||||
return {
|
||||
members,
|
||||
sortedMembers
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user