Skip to content

Commit

Permalink
[CHORE] #16 - add initialState in AddTable
Browse files Browse the repository at this point in the history
  • Loading branch information
kingyong9169 committed Dec 5, 2021
1 parent a47de35 commit 815c23d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions client/src/components/AddTable/ColumnElement/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ export default function ColumnElement({ element, remove }) {
const [isDisabled, setDisabled] = useState(false);

function pkSelect(isPK) {
element.PK = isPK.target.value;
console.log(element);
element.PK = Boolean(isPK.target.value);
setDisabled(!isDisabled);
if (isPK.target.value) {
element.FK = false;
Expand Down
2 changes: 1 addition & 1 deletion client/src/components/AddTable/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export default function AddTable() {

const initialState = {
columnName: "",
dataType: "",
dataType: "CHAR",
constraint: false,
default: "",
PK: false,
Expand Down

0 comments on commit 815c23d

Please sign in to comment.