Add controllers for transaction

This commit is contained in:
Moe Poi ~ 2021-11-21 09:57:12 +07:00
parent 030570f10a
commit bef3abde74

View file

@ -124,11 +124,24 @@ function checkout(
.catch((error) => [error.status, []]); .catch((error) => [error.status, []]);
} }
function transaction(key) {
const conf = {
params: {
key: key,
}
};
return axios
.post(HOST + "/transaction", null, conf)
.then((response) => [response.status, response.data])
.catch((error) => [error.status, []]);
}
module.exports = { module.exports = {
getProducts, getProducts,
getProduct, getProduct,
register, register,
login, login,
verify_mail, verify_mail,
checkout checkout,
transaction
}; };