@@ -353,7 +353,7 @@ func RegisterWish(context *gin.Context) {
353
353
}
354
354
355
355
// Verify unique wish name in wishlist
356
- unique_wish_name , err := database .VerifyUniqueWishNameinWishlist (wish .Name , wishlist_id_int )
356
+ unique_wish_name , err := database .VerifyUniqueWishNameInWishlist (wish .Name , wishlist_id_int )
357
357
if err != nil {
358
358
log .Println ("Failed to verify unique wishlist name. Error: " + err .Error ())
359
359
context .JSON (http .StatusInternalServerError , gin.H {"error" : "Failed to verify unique wishlist name." })
@@ -974,7 +974,7 @@ func APIUpdateWish(context *gin.Context) {
974
974
return
975
975
}
976
976
977
- unique_wish_name , err := database .VerifyUniqueWishNameinWishlist (wish .Name , wishOriginal .WishlistID )
977
+ unique_wish_name , err := database .VerifyUniqueWishNameInWishlist (wish .Name , wishOriginal .WishlistID )
978
978
if err != nil {
979
979
log .Println ("Failed to verify wish name. Error: " + err .Error ())
980
980
context .JSON (http .StatusInternalServerError , gin.H {"error" : "Failed to verify wish name." })
@@ -989,7 +989,7 @@ func APIUpdateWish(context *gin.Context) {
989
989
wishOriginal .Name = strings .TrimSpace (wish .Name )
990
990
}
991
991
992
- if wish .URL != wishOriginal .URL && wish . URL != "" {
992
+ if wish .URL != wishOriginal .URL {
993
993
// Validate wish URL format
994
994
stringMatch , requirements , err := utilities .ValidateTextCharacters (wish .URL )
995
995
if err != nil {
@@ -1014,8 +1014,7 @@ func APIUpdateWish(context *gin.Context) {
1014
1014
wishOriginal .URL = strings .TrimSpace (wish .URL )
1015
1015
}
1016
1016
1017
- if wish .Note != wishOriginal .Note && wish .Note != "" {
1018
-
1017
+ if wish .Note != wishOriginal .Note {
1019
1018
// Validate wish note format
1020
1019
stringMatch , requirements , err := utilities .ValidateTextCharacters (wish .Note )
1021
1020
if err != nil {
@@ -1033,7 +1032,7 @@ func APIUpdateWish(context *gin.Context) {
1033
1032
wishOriginal .Note = strings .TrimSpace (wish .Note )
1034
1033
}
1035
1034
1036
- if wish .Price != wishOriginal .Price && wish . Price != 0 {
1035
+ if wish .Price != wishOriginal .Price {
1037
1036
wishOriginal .Price = wish .Price
1038
1037
}
1039
1038
0 commit comments