Skip to content
Snippets Groups Projects
Commit cff605bc authored by meskio's avatar meskio :tent:
Browse files

Add phone number to members

parent 1ed577db
No related branches found
No related tags found
No related merge requests found
...@@ -16,6 +16,7 @@ type Member struct { ...@@ -16,6 +16,7 @@ type Member struct {
Num int `json:"num" gorm:"unique;index"` Num int `json:"num" gorm:"unique;index"`
Name string `json:"name" gorm:"unique;index"` Name string `json:"name" gorm:"unique;index"`
Email string `json:"email"` Email string `json:"email"`
Phone string `json:"phone"`
Balance int `json:"balance"` Balance int `json:"balance"`
Role string `json:"role"` Role string `json:"role"`
PassHash []byte `json:"-"` PassHash []byte `json:"-"`
......
...@@ -4,8 +4,8 @@ TOKEN="$1" ...@@ -4,8 +4,8 @@ TOKEN="$1"
ADDR="localhost:8080" ADDR="localhost:8080"
# set up members # 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": 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", "password": "socia", "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 # set up products
curl -H "x-authentication: $TOKEN" -X "POST" -d '{"code": 234, "name": "aceite", "price": 1700, "stock": 35}' $ADDR/api/product curl -H "x-authentication: $TOKEN" -X "POST" -d '{"code": 234, "name": "aceite", "price": 1700, "stock": 35}' $ADDR/api/product
......
...@@ -18,6 +18,7 @@ class MemberList extends React.Component { ...@@ -18,6 +18,7 @@ class MemberList extends React.Component {
<td>{member.num}</td> <td>{member.num}</td>
<td>{member.name}</td> <td>{member.name}</td>
<td>{member.email}</td> <td>{member.email}</td>
<td>{member.phone}</td>
<td>{printMoney(member.balance)} </td> <td>{printMoney(member.balance)} </td>
</tr> </tr>
); );
...@@ -34,6 +35,7 @@ class MemberList extends React.Component { ...@@ -34,6 +35,7 @@ class MemberList extends React.Component {
<th>Numero</th> <th>Numero</th>
<th>Nombre</th> <th>Nombre</th>
<th>Email</th> <th>Email</th>
<th>Telefono</th>
<th>Saldo</th> <th>Saldo</th>
</tr> </tr>
</thead> </thead>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment