Skip to content

Commit

Permalink
ok
Browse files Browse the repository at this point in the history
  • Loading branch information
alan345 committed Jul 19, 2024
1 parent 5ec658b commit 5a8c769
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 14 deletions.
5 changes: 1 addition & 4 deletions client/src/auth/Login.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,7 @@ export function Login() {
createWorkerMutation.mutate(
{ login: "", password: "" },
{
onSuccess: () => {
context.updateUserId();
// props.onSuccess();
},
onSuccess: () => context.updateUserId(),
}
);
};
Expand Down
8 changes: 3 additions & 5 deletions client/src/user/Users.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,10 @@ export function Users() {
<thead>
<tr>
<th>ID</th>
<th>Created At</th>
<th>First Name</th>
<th>Last Name</th>
<th>Email</th>
<th>Phone</th>
<th>Status</th>
<th></th>
<th>avatar</th>
</tr>
</thead>
<tbody>
Expand All @@ -45,7 +44,6 @@ export function Users() {
<td>{worker.last_name}</td>
<td>{worker.email}</td>
<td>{worker.avatar}</td>
<td></td>
</tr>
))}
</tbody>
Expand Down
8 changes: 3 additions & 5 deletions server/api/randomDataApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import axios, { AxiosRequestConfig } from "axios";
import { User } from "../type/User.type";

// Todo: Add logic to get the correct uri based on the environment
const uri = "https://random-data-api.com/api/v2/users?size=2";
const uri = "https://random-data-api.com/api/v2/users";

export const randomDataApi = {
createWorker: async (phoneNumber: string, email: string): Promise<User> => {
Expand Down Expand Up @@ -33,12 +33,10 @@ export const randomDataApi = {
try {
let res = await axios.get(uri, {
params: {
page,
per_page: 10,
size: 10,
},
});
console.log("res");
console.log(res.data);

return res.data;
} catch (error: any) {
if (axios.isAxiosError(error) && error && error.response) {
Expand Down

0 comments on commit 5a8c769

Please sign in to comment.