Skip to content

Commit

Permalink
cleanup code
Browse files Browse the repository at this point in the history
  • Loading branch information
huytran17 committed Jul 28, 2024
1 parent 57d3128 commit 817b431
Show file tree
Hide file tree
Showing 21 changed files with 21 additions and 133 deletions.
2 changes: 1 addition & 1 deletion core/admin-dashboard/store/admin/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ export const state = () => ({
admin: {} as any,
admins: [] as any[],
admin_analys_data: {} as Record<string, unknown>,
pagination: {
pagination: <IPagination>{
current_page: 1,
from: 0,
to: 1,
Expand Down
10 changes: 1 addition & 9 deletions core/admin-dashboard/store/admin/mutations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,7 @@ const mutations: MutationTree<AdminState> = {
{
data,
}: {
data: {
current_page: number;
per_page: number;
total: number;
total_pages: number;
from: number;
to: number;
has_more: boolean;
};
data: IPagination;
}
) {
state.pagination = data;
Expand Down
2 changes: 1 addition & 1 deletion core/admin-dashboard/store/gallery/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export const state = () => ({
gallery: {} as any,
galleries: [] as any,
pagination: {
pagination: <IPagination>{
current_page: 1,
from: 0,
to: 1,
Expand Down
10 changes: 1 addition & 9 deletions core/admin-dashboard/store/gallery/mutations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,7 @@ const mutations: MutationTree<GalleryState> = {
{
data,
}: {
data: {
current_page: number;
per_page: number;
total: number;
total_pages: number;
from: number;
to: number;
has_more: boolean;
};
data: IPagination;
}
) {
state.pagination = data;
Expand Down
2 changes: 1 addition & 1 deletion core/admin-dashboard/store/user/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ export const state = () => ({
user: {} as any,
user_analys_data: {} as any,
users: [] as any[],
pagination: {
pagination: <IPagination>{
current_page: 1,
from: 0,
to: 1,
Expand Down
10 changes: 1 addition & 9 deletions core/server/src/data-access/interfaces/admin-db.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,7 @@ export default interface IAdminDb {

export interface IPaginatedAdminsResult {
data: IAdmin[];
pagination: {
current_page: number;
from: number;
to: number;
per_page: number;
total: number;
total_pages: number;
has_more: boolean;
};
pagination: IPagination;
}

export interface IAdminAnalyticsData {
Expand Down
10 changes: 1 addition & 9 deletions core/server/src/data-access/interfaces/category-db.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,7 @@ export default interface ICategoryDb {

export interface IPaginatedCategoriesResult {
data: ICategory[];
pagination: {
current_page: number;
from: number;
to: number;
per_page: number;
total: number;
total_pages: number;
has_more: boolean;
};
pagination: IPagination;
}

export interface ICategoryAnalyticsData {
Expand Down
10 changes: 1 addition & 9 deletions core/server/src/data-access/interfaces/comment-db.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,5 @@ export default interface ICommentDb {

export interface IPaginatedCommentsResult {
data: IComment[];
pagination: {
current_page: number;
from: number;
to: number;
per_page: number;
total: number;
total_pages: number;
has_more: boolean;
};
pagination: IPagination;
}
10 changes: 1 addition & 9 deletions core/server/src/data-access/interfaces/gallery-db.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,5 @@ export default interface IGalleryDb {

export interface IPaginatedGalleriesResult {
data: IGallery[];
pagination: {
current_page: number;
from: number;
to: number;
per_page: number;
total: number;
total_pages: number;
has_more: boolean;
};
pagination: IPagination;
}
10 changes: 1 addition & 9 deletions core/server/src/data-access/interfaces/post-bookmark-db.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,5 @@ export default interface IPostBookmarkDb {

export interface IPaginatedPostBookmarksResult {
data: IPostBookmark[];
pagination: {
current_page: number;
from: number;
to: number;
per_page: number;
total: number;
total_pages: number;
has_more: boolean;
};
pagination: IPagination;
}
10 changes: 1 addition & 9 deletions core/server/src/data-access/interfaces/post-db.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,15 +65,7 @@ export default interface IPostDb {

export interface IPaginatedPostsResult {
data: IPost[];
pagination: {
current_page: number;
from: number;
to: number;
per_page: number;
total: number;
total_pages: number;
has_more: boolean;
};
pagination: IPagination;
}

export interface IPostAnalytics {
Expand Down
10 changes: 1 addition & 9 deletions core/server/src/data-access/interfaces/subscription-db.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,7 @@ export default interface ISubscriptionDb {

export interface IPaginatedSubscriptionsResult {
data: ISubscription[];
pagination: {
current_page: number;
from: number;
to: number;
per_page: number;
total: number;
total_pages: number;
has_more: boolean;
};
pagination: IPagination;
}

export interface ISubscriptionAnalyticsData {
Expand Down
10 changes: 1 addition & 9 deletions core/server/src/data-access/interfaces/user-db.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,7 @@ export default interface IUserDb {

export interface IPaginatedUsersResult {
data: IUser[];
pagination: {
current_page: number;
from: number;
to: number;
per_page: number;
total: number;
total_pages: number;
has_more: boolean;
};
pagination: IPagination;
}

export interface IUserAnalyticsData {
Expand Down
2 changes: 1 addition & 1 deletion core/user-dashboard/store/category/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ export const state = () => ({
category: {} as any,
categories: [] as any[],
category_titles: [] as any[],
pagination: {
pagination: <IPagination>{
current_page: 1,
from: 0,
to: 1,
Expand Down
10 changes: 1 addition & 9 deletions core/user-dashboard/store/category/mutations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,7 @@ const mutations: MutationTree<CategoryState> = {
{
data,
}: {
data: {
current_page: number;
per_page: number;
total: number;
total_pages: number;
from: number;
to: number;
has_more: boolean;
};
data: IPagination;
}
) {
state.pagination = data;
Expand Down
2 changes: 1 addition & 1 deletion core/user-dashboard/store/comment/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export const state = () => ({
new_reply_comment: {} as any,
editing_comment: {} as any,
comments: [] as any[],
pagination: {
pagination: <IPagination>{
current_page: 1,
from: 0,
to: 1,
Expand Down
10 changes: 1 addition & 9 deletions core/user-dashboard/store/comment/mutations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,7 @@ const mutations: MutationTree<CommentState> = {
{
data,
}: {
data: {
current_page: number;
per_page: number;
total: number;
total_pages: number;
from: number;
to: number;
has_more: boolean;
};
data: IPagination;
}
) {
state.pagination = data;
Expand Down
2 changes: 1 addition & 1 deletion core/user-dashboard/store/post-bookmark/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ export const state = () => ({
post_bookmark: {} as any,
post_bookmarks: [] as any[],
post_bookmarks_count: 0,
pagination: {
pagination: <IPagination>{
current_page: 1,
from: 0,
to: 1,
Expand Down
10 changes: 1 addition & 9 deletions core/user-dashboard/store/post-bookmark/mutations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,7 @@ const mutations: MutationTree<PostBookmarkState> = {
{
data,
}: {
data: {
current_page: number;
per_page: number;
total: number;
total_pages: number;
from: number;
to: number;
has_more: boolean;
};
data: IPagination;
}
) {
state.pagination = data;
Expand Down
2 changes: 1 addition & 1 deletion core/user-dashboard/store/post/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export const state = () => ({
post: {} as any,
pagination: {
pagination: <IPagination>{
current_page: 1,
from: 0,
to: 1,
Expand Down
10 changes: 1 addition & 9 deletions core/user-dashboard/store/post/mutations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,7 @@ const mutations: MutationTree<PostState> = {
{
data,
}: {
data: {
current_page: number;
per_page: number;
total: number;
total_pages: number;
from: number;
to: number;
has_more: boolean;
};
data: IPagination;
}
) {
state.pagination = data;
Expand Down

0 comments on commit 817b431

Please sign in to comment.