-
Notifications
You must be signed in to change notification settings - Fork 2
/
sandbox.ejs
53 lines (48 loc) · 1.17 KB
/
sandbox.ejs
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
async function create(post){
const res = await axios({
url: BASE_URL,
method: 'POST',
headers: {
'content-type': 'application/json',
'Authorization' : `Bearer ${tokenService.getToken()}`
},
body: JSON.stringify(post)
})
const data = await res.json()
console.log(data)
return data
}
function getAll(){
return axios({
url: BASE_URL,
headers: {
'Authorization' : `Bearer ${tokenService.getToken()}`
},
})
.then(res => res.json())
}
{user.profile === postThread.owner?._id ?
<form autoComplete="off" ref={formElement} onSubmit={handleSubmit}>
<h4>Have evidence to support your statement? Provide it here!</h4>
<div>
<input type="text"
name="source"
id="source-input"
value={formData.evidence?.source}
onChange={handleChange}
/>
<br />
<textarea
type="text"
name="notes"
id="notes-input"
cols="30" rows="10"
value={formData.evidence?.notes}
onChange={handleChange}
/>
</div>
<button type="submit">submit</button>
</form>
:
<></>
}