resource-watch/widget

View on GitHub
app/src/services/user.service.js

Summary

Maintainability
A
1 hr
Test Coverage
A
100%
const { RWAPIMicroservice } = require('rw-api-microservice-node');

class UserService {

    static async getUserById(userId, apiKey) {
        const body = await RWAPIMicroservice.requestToMicroservice({
            uri: `/auth/user/${userId}`,
            method: 'GET',
            json: true,
            version: false,
            headers: {
                'x-api-key': apiKey,
            }
        });
        return body.data;
    }

}

module.exports = UserService;