Closed umutgun17 closed 2 years ago
There are CORS and HTTPS problem.
The frontend responses as a HTTPS whereas the backend responses ad a HTTP so we cannot request post from HTTPS to HTTP client.
CORS problem was solved by backend team
I communicated with Didem to use Auth.
I need it to recognize me by backend. It basically means that there is a token on header and all post method has that token. Therefore, backend understand which user send the post.
I learned axios and examples code.
I integrated the event detail page with the backend API.
The simple code is below.
export function getEvent(me, event_id) {
return httpClient
.post(`/post/get_event_post_details/`, {
'@context': 'https://www.w3.org/ns/activitystreams',
summary: `${me.name} is reading an event post.`,
type: 'View',
actor: {
type: 'Person',
name: `${me.name}`,
surname: `${me.surname}`,
username: `${me.username}`,
Id: Number.parseInt(me.Id),
},
object: {
type: 'EventPost',
post_id: Number.parseInt(event_id),
},
})
.then(res => res.data);
}
I will integrate the event page with backend I will communicate with the backend team I will communicate with the Didem about auth (authantication token)