File tree Expand file tree Collapse file tree 2 files changed +4
-5
lines changed Expand file tree Collapse file tree 2 files changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -219,18 +219,17 @@ function UserController() {
219
219
this . unfollowSharkWallet = async ( req , res , next ) => {
220
220
let { userId, sharkId } = req . body ;
221
221
222
- if ( ! userId ) userId = null ;
222
+ if ( ! userId || _ . isEmpty ( userId ) ) userId = null ;
223
223
else {
224
224
if ( isNaN ( userId ) ) userId = undefined ;
225
225
else userId = Number ( userId ) ;
226
226
}
227
227
228
- if ( ! sharkId ) sharkId = null ;
228
+ if ( ! sharkId || _ . isEmpty ( sharkId ) ) sharkId = null ;
229
229
else {
230
230
if ( isNaN ( sharkId ) ) sharkId = undefined ;
231
231
else sharkId = Number ( sharkId ) ;
232
232
}
233
-
234
233
await unfollowWalletOfShark ( userId , sharkId )
235
234
. then ( ( data ) => {
236
235
if ( data . message === "success" )
Original file line number Diff line number Diff line change @@ -239,8 +239,8 @@ const followWalletOfShark = async (userId, sharkId) => {
239
239
240
240
const unfollowWalletOfShark = async ( userId , sharkId ) => {
241
241
try {
242
- if ( userId === null ) return "userid-required" ;
243
- if ( userId === undefined ) return "userid-invalid" ;
242
+ if ( userId === null ) return { message : "userid-required" } ;
243
+ if ( userId === undefined ) return { message : "userid-invalid" } ;
244
244
if ( sharkId === null ) return { message : "sharkid-required" } ;
245
245
if ( sharkId === undefined ) return { message : "sharkid-invalid" } ;
246
246
You can’t perform that action at this time.
0 commit comments