Universes
Get all universes
fetch('https://fakegundamwikiapi.onrender.com/api/universes', {
method: 'GET',
headers: {
'Authorization': 'Bearer YOUR_TOKEN_HERE',
'Content-Type': 'application/json'
}
})
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error('Error:', err));
[
{
"universeId": 1,
"universeName": "Universal Century",
"isActive": true,
"created": "2024-02-09T23:51:27.8694251",
"createdBy": null,
"lastModified": "2024-02-09T23:51:27.8696064",
"lastModifiedBy": null
}
]
Get a single universe
fetch('https://fakegundamwikiapi.onrender.com/api/universes', {
method: 'GET',
headers: {
'Authorization': 'Bearer YOUR_TOKEN_HERE',
'Content-Type': 'application/json'
}
})
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error('Error:', err));
{
"universeId": 1,
"universeName": "Universal Century",
"isActive": true,
"created": "2024-02-09T23:51:27.8694251",
"createdBy": null,
"lastModified": "2024-02-09T23:51:27.8696064",
"lastModifiedBy": null
}
Create a new universe
fetch('https://fakegundamwikiapi.onrender.com/api/universes', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_TOKEN_HERE',
'Content-Type': 'application/json'
},
body: JSON.stringify({
'universeName': 'Universal Century'
})
})
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error('Error:', err));
{
"universeId": 1,
"universeName": "Universal Century",
"isActive": true,
"created": "2024-02-09T23:51:27.8694251",
"createdBy": null,
"lastModified": "2024-02-09T23:51:27.8696064",
"lastModifiedBy": null
}
Update a universe
fetch('https://fakegundamwikiapi.onrender.com/api/universes/1', {
method: 'PUT',
headers: {
'Authorization': 'Bearer YOUR_TOKEN_HERE',
'Content-Type': 'application/json'
},
body: JSON.stringify({
'universeId': 1
'universeName': 'Universal Century'
})
})
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error('Error:', err));
{
"universeId": 1,
"universeName": "Universal Century",
"isActive": true,
"created": "2024-02-09T23:51:27.8694251",
"createdBy": null,
"lastModified": "2024-02-09T23:51:27.8696064",
"lastModifiedBy": null
}
Active/Inactive a universe
fetch('https://fakegundamwikiapi.onrender.com/api/universes/1', {
method: 'DELETE',
headers: {
'Authorization': 'Bearer YOUR_TOKEN_HERE',
'Content-Type': 'application/json'
}
});