feat: improve profile navigation and responsive privacy UX
This commit is contained in:
@@ -265,6 +265,12 @@ class ApiClient {
|
||||
);
|
||||
}
|
||||
|
||||
async getPublicProfile(username: string) {
|
||||
return this.request<Types.PublicMemberProfileSchema>(
|
||||
`/api/auth/public-profile/${encodeURIComponent(username)}`,
|
||||
);
|
||||
}
|
||||
|
||||
async updateProfile(data: Types.UserUpdateSchema) {
|
||||
return this.request<Types.UserProfileSchema>('/api/auth/profile', {
|
||||
method: 'PUT',
|
||||
@@ -711,6 +717,18 @@ class ApiClient {
|
||||
return this.request<Types.BlogProfileActivitySchema>('/api/blog/me/activity');
|
||||
}
|
||||
|
||||
async getMyBlogPostsPage(section: "liked" | "saved", page: number) {
|
||||
return this.request<Types.PaginatedResponseSchema<Types.PostListSchema>>(
|
||||
`/api/blog/me/activity/${section}?page=${page}`,
|
||||
);
|
||||
}
|
||||
|
||||
async getMyBlogCommentsPage(page: number) {
|
||||
return this.request<Types.PaginatedResponseSchema<Types.CommentSchema>>(
|
||||
`/api/blog/me/activity/comments?page=${page}`,
|
||||
);
|
||||
}
|
||||
|
||||
// Categories
|
||||
async getCategories() {
|
||||
return this.request<Types.CategorySchema[]>('/api/blog/categories');
|
||||
@@ -982,6 +1000,35 @@ class ApiClient {
|
||||
);
|
||||
}
|
||||
|
||||
async getMyRegistrationsPage(
|
||||
status: Types.MyEventRegistrationSchema["status"] | "all",
|
||||
sortBy: "start_time" | "title",
|
||||
sortOrder: "asc" | "desc",
|
||||
page: number,
|
||||
) {
|
||||
const params = new URLSearchParams({
|
||||
status,
|
||||
sort_by: sortBy,
|
||||
sort_order: sortOrder,
|
||||
page: String(page),
|
||||
});
|
||||
return this.request<Types.PaginatedResponseSchema<Types.MyEventRegistrationSchema>>(
|
||||
`/api/events/my-registrations/paginated?${params.toString()}`,
|
||||
{ method: "GET" },
|
||||
);
|
||||
}
|
||||
|
||||
async getMyPayments() {
|
||||
return this.request<Types.UserPaymentSchema[]>("/api/payments/me", { method: "GET" });
|
||||
}
|
||||
|
||||
async getMyPaymentsPage(page: number) {
|
||||
return this.request<Types.PaginatedResponseSchema<Types.UserPaymentSchema>>(
|
||||
`/api/payments/me/paginated?page=${page}`,
|
||||
{ method: "GET" },
|
||||
);
|
||||
}
|
||||
|
||||
async getRegistrationStatus(eventId: number) {
|
||||
return this.request<Types.RegistrationStatusSchema>(
|
||||
`/api/events/${eventId}/is-registered`,
|
||||
|
||||
Reference in New Issue
Block a user