Skip to content

Commit 1ca98ce

Browse files
author
Akhil Gupta
committed
fix change password and support 3 decimal places
1 parent d41a41e commit 1ca98ce

File tree

7 files changed

+14
-10
lines changed

7 files changed

+14
-10
lines changed

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
</a> -->
99

1010
<h1 align="center" style="margin-bottom:0">Hammond</h1>
11-
<p align="center">Current Version - 2021.05.29</p>
11+
<p align="center">Current Version - 2021.06.01</p>
1212

1313
<p align="center">
1414
A self-hosted vehicle expense tracking system with support for multiple users.
@@ -55,7 +55,7 @@ The current version of Hammond is written using GO for backend and Vuejs for the
5555

5656
Also I had initially thought of a 2 container approach (1 for backend and 1 for the frontend) so that they can be independently maintained and updated. I eventually decided against this idea for the sake of simplicity. Although it is safe to assume that most self-hosters are fairly tech capable it still is much better to have a single container that you can fire and forget.
5757

58-
![Product Name Screen Shot][product-screenshot] [More Screenshots](Shreenshots.md)
58+
![Product Name Screen Shot][product-screenshot] [More Screenshots](Screenshots.md)
5959

6060
### Built With
6161

Shreenshots.md Screenshots.md

File renamed without changes.

server/controllers/auth.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ func changePassword(c *gin.Context) {
169169
}
170170

171171
if user.CheckPassword(request.OldPassword) != nil {
172-
c.JSON(http.StatusForbidden, common.NewError("changePassword", errors.New("Not Registered email or invalid password")))
172+
c.JSON(http.StatusForbidden, common.NewError("changePassword", errors.New("Incorrect old password")))
173173
return
174174
}
175175

server/models/auth.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,6 @@ type RegisterRequest struct {
2525
}
2626

2727
type ChangePasswordRequest struct {
28-
OldPassword string `form:"oldPassword" json:"oldPassword" binding:"required,min=8,max=255"`
28+
OldPassword string `form:"oldPassword" json:"oldPassword" binding:"required,max=255"`
2929
NewPassword string `form:"newPassword" json:"newPassword" binding:"required,min=8,max=255"`
3030
}

ui/src/router/views/createExpense.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ export default {
195195
type="number"
196196
min="0"
197197
expanded
198-
step=".01"
198+
step=".001"
199199
required
200200
></b-input>
201201
</b-field>

ui/src/router/views/createFillup.vue

+3-3
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ export default {
206206
<b-input
207207
v-model.number="fillupModel.fuelQuantity"
208208
type="number"
209-
step=".01"
209+
step=".001"
210210
min="0"
211211
expanded
212212
required
@@ -225,7 +225,7 @@ export default {
225225
v-model.number="fillupModel.perUnitPrice"
226226
type="number"
227227
min="0"
228-
step=".01"
228+
step=".001"
229229
expanded
230230
required
231231
></b-input>
@@ -238,7 +238,7 @@ export default {
238238
v-model.number="fillupModel.totalAmount"
239239
type="number"
240240
min="0"
241-
step=".01"
241+
step=".001"
242242
expanded
243243
required
244244
></b-input>

ui/src/router/views/settings.vue

+6-2
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,13 @@ export default {
6969
.catch((err) => console.log('error:', err))
7070
})
7171
.catch((ex) => {
72+
let errorMessage= ex.message;
73+
if(ex.response && ex.response.data?.errors?.changePassword){
74+
errorMessage=ex.response.data?.errors?.changePassword
75+
}
7276
this.$buefy.toast.open({
7377
duration: 5000,
74-
message: ex.message,
78+
message: errorMessage,
7579
position: 'is-bottom',
7680
type: 'is-danger',
7781
})
@@ -168,7 +172,7 @@ export default {
168172
<table class="table is-hoverable">
169173
<tr>
170174
<td>Current Version</td>
171-
<td>2021.05.29</td>
175+
<td>2021.06.01</td>
172176
</tr>
173177
<tr>
174178
<td>Website</td>

0 commit comments

Comments
 (0)