Skip to content

Commit dd60f99

Browse files
committed
[fix]: made service method static;
1 parent 0148c4a commit dd60f99

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

src/component/landing/Landing.tsx

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,8 @@ interface User {
2020
}
2121

2222
class UserService {
23-
async getList(params: any): Promise<{ data: User[]; total: number }> {
24-
// Implementation
25-
// return { data: [], total: 0 };
23+
static async getList(params: Partial<User>): Promise<{ data: User[]; total: number }> {
24+
console.log('Fetching user list with params:', params);
2625
return {
2726
data: [
2827
{ id: 1, name: 'John Doe', age: 30, createdAt: '2023-01-01', status: 'active', isAdmin: true },
@@ -32,18 +31,18 @@ class UserService {
3231
};
3332
}
3433

35-
async create(data: Partial<User>) {
36-
// Implementation
34+
static async create(data: Partial<User>) {
35+
console.log('Creating user:', data);
3736
return data as User;
3837
}
3938

40-
async update(id: number, data: Partial<User>) {
41-
// Implementation
39+
static async update(id: number, data: Partial<User>) {
40+
console.log(`Updating user with id ${id}:`, data);
4241
return { id, ...data } as User;
4342
}
4443

45-
async delete(id: number) {
46-
// Implementation
44+
static async delete(id: number) {
45+
console.log(`Deleting user with id ${id}`);
4746
}
4847
}
4948

0 commit comments

Comments
 (0)