Skip to content

Commit a88927c

Browse files
committed
reverted getUsers to QSP
1 parent e4d7824 commit a88927c

File tree

3 files changed

+4
-16
lines changed

3 files changed

+4
-16
lines changed

api/src/functions/getUser.js

+2-14
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,7 @@ const queryDatabase = async (db, id) => {
2828
headers: {
2929
"Content-Type": "application/json",
3030
},
31-
body: JSON.stringify({userData: JSON.stringify(user),
32-
userId : id,
33-
dbPass : MONGODB_URI
34-
}),
31+
body: JSON.stringify(user),
3532
};
3633
};
3734

@@ -68,15 +65,6 @@ app.http('getUser', {
6865
const user = decoded.payload;
6966
console.log("Decoded user from token: ", user); // Add logging here
7067

71-
return {
72-
statusCode: 200,
73-
headers: {
74-
"Content-Type": "application/json",
75-
},
76-
body: JSON.stringify({ userdetails: user }),
77-
}
78-
79-
return queryDatabase(db, user.oid);
80-
//return queryDatabase(db, user.oid);
68+
return queryDatabase(db, request.query.get('id'));
8169
}
8270
});

pages/awards.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ export default {
252252
middleware: 'isAuthenticated',
253253
async asyncData(context) {
254254
const userpoints = await context.$axios.$get(
255-
'getUser'
255+
'getUser?id=' + context.app.$auth.$storage.getUniversal('jwt_decoded').oid
256256
)
257257
258258
return {

pages/getinvolved.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ export default {
278278
middleware: 'isAuthenticated',
279279
async asyncData(context) {
280280
const userpoints = await context.$axios.$get(
281-
'getUser'
281+
'getUser?id=' + context.app.$auth.$storage.getUniversal('jwt_decoded').oid
282282
)
283283
284284
return {

0 commit comments

Comments
 (0)