so I have a function (getBagId) that I want to return the bag id, I know its not returning it due to the async nature, but how would i go about fixing it so it returns the bagId, heres the code
const getBagId = () => {
request.get('https://www.off---white.com/en-us/api/users/me', options, (err, res, data) => {
bagId = data.bagId
})
return bagId
}
once again I want the function to return bagId so the value is set to that, also i want to do this only using callbacks, no promises or async await, thanks