-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathedit_trans.js
34 lines (26 loc) · 868 Bytes
/
edit_trans.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
async function edit_trans() {
const userID = document.getElementById("userID");
const uId = userID.value;
const transID = document.getElementById("transID");
const tID = transID.value;
const title = document.getElementById("title");
const uTitle = title.value;
const value = document.getElementById("value");
const uValue = value.value;
const type = document.getElementById("type");
const uType = type.value;
let html
const dom = document.getElementById('resposta')
await axios.put(`${url}/user/${uId}/transaction/${tID}`, {
title: uTitle,
value: uValue,
type: uType
})
.then(function (response) {
html = response
dom.innerHTML = html.data;
})
.catch(function (error) {
dom.innerHTML = "<h2> Usuário ou transação não encontrado</h2><br><h2>Ou transação invalida</h2>";
})
}