diff --git a/api/member.go b/api/member.go index e52b327991d39a4fcfc96cfcb6eb0eda861cd265..353e92d8ab77543364256e20859199a16f04e4a0 100644 --- a/api/member.go +++ b/api/member.go @@ -16,6 +16,7 @@ type Member struct { Num int `json:"num" gorm:"unique;index"` Name string `json:"name" gorm:"unique;index"` Email string `json:"email"` + Phone string `json:"phone"` Balance int `json:"balance"` Role string `json:"role"` PassHash []byte `json:"-"` diff --git a/setup.sh b/setup.sh index 1214cc95c82a67b0bd47fc660be989a8fc2014a0..abace7d528a9282c80e08560e1c8ba1dd8689b10 100755 --- a/setup.sh +++ b/setup.sh @@ -4,8 +4,8 @@ TOKEN="$1" ADDR="localhost:8080" # set up members -curl -H "x-authentication: $TOKEN" -X "POST" -d '{"num": 900, "name": "admin", "email": "admin@example.com", "password": "admin", "role": "admin", "balance": 10000}' $ADDR/api/member -curl -H "x-authentication: $TOKEN" -X "POST" -d '{"num": 901, "name": "socia", "email": "socia@example.com", "password": "socia", "balance": 10000}' $ADDR/api/member +curl -H "x-authentication: $TOKEN" -X "POST" -d '{"num": 900, "name": "admin", "email": "admin@example.com", "phone": "654321123", "password": "admin", "role": "admin", "balance": 10000}' $ADDR/api/member +curl -H "x-authentication: $TOKEN" -X "POST" -d '{"num": 901, "name": "socia", "email": "socia@example.com", "phone": "678900123", "password": "socia", "balance": 10000}' $ADDR/api/member # set up products curl -H "x-authentication: $TOKEN" -X "POST" -d '{"code": 234, "name": "aceite", "price": 1700, "stock": 35}' $ADDR/api/product diff --git a/src/MemberList.js b/src/MemberList.js index 7300c02206e3514ea69c16773e8678596f36bf61..ebd52ee48156c2355a5e65590d3d6fd9eed301e9 100644 --- a/src/MemberList.js +++ b/src/MemberList.js @@ -18,6 +18,7 @@ class MemberList extends React.Component { <td>{member.num}</td> <td>{member.name}</td> <td>{member.email}</td> + <td>{member.phone}</td> <td>{printMoney(member.balance)} €</td> </tr> ); @@ -34,6 +35,7 @@ class MemberList extends React.Component { <th>Numero</th> <th>Nombre</th> <th>Email</th> + <th>Telefono</th> <th>Saldo</th> </tr> </thead>