Member page
This commit is contained in:
@@ -1,43 +1,58 @@
|
||||
export interface Permission {
|
||||
resource: string;
|
||||
action: string;
|
||||
}
|
||||
// Role type as a string literal
|
||||
export type Role = 'admin' | 'user';
|
||||
export interface Role {
|
||||
id: string;
|
||||
name: string;
|
||||
permissions: Permission[];
|
||||
}
|
||||
|
||||
// Status type as a string literal
|
||||
export type Status = 'Active' | 'Inactive';
|
||||
export type Status = "Active" | "Inactive";
|
||||
|
||||
// Event type (you can expand this type as needed based on your schema)
|
||||
export interface Event {
|
||||
eventID: string;
|
||||
title: string;
|
||||
date: string; // Assuming ISO date string
|
||||
eventID: string;
|
||||
title: string;
|
||||
date: string; // Assuming ISO date string
|
||||
}
|
||||
|
||||
// Blog type (you may already have this defined as shown in your previous example)
|
||||
export interface Blog {
|
||||
blogID: string;
|
||||
slug: string;
|
||||
content: string;
|
||||
label?: string;
|
||||
authorID: string;
|
||||
published: string;
|
||||
summary?: string;
|
||||
image?: string;
|
||||
href?: string;
|
||||
blogID: string;
|
||||
slug: string;
|
||||
content: string;
|
||||
label?: string;
|
||||
authorID: string;
|
||||
published: string;
|
||||
summary?: string;
|
||||
image?: string;
|
||||
href?: string;
|
||||
|
||||
author: User; // Relation to User
|
||||
author: User; // Relation to User
|
||||
}
|
||||
|
||||
// User type definition
|
||||
export interface User {
|
||||
userID: string; // UUID represented as a string
|
||||
firstName: string;
|
||||
lastName: string;
|
||||
email: string;
|
||||
password?: string; // Optional field, since it's omitted in the JSON
|
||||
phone: string;
|
||||
role: Role; // 'admin' or 'user'
|
||||
createdAt: string; // ISO date string
|
||||
updatedAt: string; // ISO date string
|
||||
userId: string; // UUID represented as a string
|
||||
firstname: string;
|
||||
lastname: string;
|
||||
email: string;
|
||||
password?: string; // Optional field, since it's omitted in the JSON
|
||||
phone: string;
|
||||
role: Role; // 'admin' or 'user'
|
||||
createdAt: string; // ISO date string
|
||||
updatedAt: string; // ISO date string
|
||||
|
||||
events?: Event[]; // Many-to-many relation with Event (optional)
|
||||
articles?: Blog[]; // One-to-many relation with Blog (optional)
|
||||
events?: Event[]; // Many-to-many relation with Event (optional)
|
||||
articles?: Blog[]; // One-to-many relation with Blog (optional)
|
||||
roles?: Role[];
|
||||
}
|
||||
|
||||
export interface ApiResponse<T> {
|
||||
status: "Error" | "Success";
|
||||
message: string;
|
||||
data?: T;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user