mirror of
https://github.com/mattermost/mattermost.git
synced 2026-03-05 23:01:03 -05:00
18 lines
442 B
JavaScript
18 lines
442 B
JavaScript
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
|
// See LICENSE.txt for license information.
|
|
|
|
const axios = require('axios');
|
|
|
|
module.exports = async ({url, data}) => {
|
|
let response;
|
|
|
|
try {
|
|
response = await axios({method: 'post', url, data});
|
|
} catch (err) {
|
|
if (err.response) {
|
|
response = err.response;
|
|
}
|
|
}
|
|
|
|
return {status: response.status, data: response.data};
|
|
};
|