Skip to content

Commit

Permalink
latest update query
Browse files Browse the repository at this point in the history
  • Loading branch information
RedDotz20 committed Nov 28, 2022
1 parent f7241ad commit 870695d
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions client/src/data/Data.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { formatPascalCase } from "../utilities/formatString";
import Axios from "axios";

const PORT = 3000;
const URL = `http://localhost:${PORT}`;

Expand Down Expand Up @@ -29,12 +30,12 @@ export function InsertQuery(values) {
//* Update Query Function
export function UpdateQuery(values, id) {
Axios.put(`${URL}/update`, {
firstName: values.firstName,
lastName: values.lastName,
age: values.age,
firstName: formatPascalCase(values.firstName),
lastName: formatPascalCase(values.lastName),
age: parseInt(values.age),
sex: values.sex,
phoneNumber: values.phoneNumber,
id: id,
id: parseInt(id),
}).catch((error) => console.log(error));
}

Expand Down

0 comments on commit 870695d

Please sign in to comment.