Skip to content

Commit b8b9d13

Browse files
fix unfollow and server port
1 parent 8f7bf17 commit b8b9d13

File tree

4 files changed

+11
-6
lines changed

4 files changed

+11
-6
lines changed

.vscode/settings.json

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"appService.defaultWebAppToDeploy": "/subscriptions/db5d361c-ae71-48db-8608-663b36fae335/AppServices/subscriptions/db5d361c-ae71-48db-8608-663b36fae335/resourceGroups/appsvc_linux_centralus/providers/Microsoft.Web/sites/trackscan-be",
3+
"appService.deploySubpath": "."
4+
}

src/controllers/User.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -219,13 +219,13 @@ function UserController() {
219219
this.unfollowSharkWallet = async (req, res, next) => {
220220
let { userId, sharkId } = req.body;
221221

222-
if (!userId || _.isEmpty(userId)) userId = null;
222+
if (!userId) userId = null;
223223
else {
224224
if (isNaN(userId)) userId = undefined;
225225
else userId = Number(userId);
226226
}
227227

228-
if (!sharkId || _.isEmpty(sharkId)) sharkId = null;
228+
if (!sharkId) sharkId = null;
229229
else {
230230
if (isNaN(sharkId)) sharkId = undefined;
231231
else sharkId = Number(sharkId);

src/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ const swaggerOptions = {
2323
},
2424
servers: [
2525
{
26-
url: "http://localhost:4000"
26+
url: "https://trackscan-be.azurewebsites.net"
2727
}
2828
]
2929
},

src/services/crud-database/user.js

+4-3
Original file line numberDiff line numberDiff line change
@@ -239,8 +239,8 @@ const followWalletOfShark = async (userId, sharkId) => {
239239

240240
const unfollowWalletOfShark = async (userId, sharkId) => {
241241
try {
242-
if (userId === null) return { message: "userid-required"};
243-
if (userId === undefined) return { message: "userid-invalid"};
242+
if (userId === null) return { message: "userid-required" };
243+
if (userId === undefined) return { message: "userid-invalid" };
244244
if (sharkId === null) return { message: "sharkid-required" };
245245
if (sharkId === undefined) return { message: "sharkid-invalid" };
246246

@@ -271,6 +271,7 @@ const unfollowWalletOfShark = async (userId, sharkId) => {
271271

272272
return {
273273
message: "success",
274+
data: { ...shark, isFollowed: false }
274275
};
275276
} catch (error) {
276277
return { message: "error-unfollow-failed", error: error };
@@ -347,7 +348,7 @@ const getTransactionsOfAllSharks = async (page, valueFilter = 0) => {
347348
.sort({ timeStamp: "desc" })
348349
.skip((page - 1) * QUERY_LIMIT_ITEM)
349350
.limit(QUERY_LIMIT_ITEM);
350-
351+
351352
return transactions || [];
352353
};
353354

0 commit comments

Comments
 (0)