// api.js | |
const axios = require('axios'); | |
const deleteUser = async (userId) => { | |
try { | |
const response = await axios.delete(`https://api.example.com/users/${userId}`); | |
return response.data; | |
} catch (error) { | |
throw error; | |
} | |
}; | |
module.exports = deleteUser; |