Series
Get all series
fetch('https://fakegundamwikiapi.onrender.com/api/series', {
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));
[
{
"serieId": 1,
"serieName": "Mobile Suit Gundam",
"universe": {
"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
},
"isActive": true,
"created": "2024-02-11T17:00:29.6279104",
"createdBy": null,
"lastModified": "2024-02-11T17:00:29.6279259",
"lastModifiedBy": null
}
]
Get a single serie
fetch('https://fakegundamwikiapi.onrender.com/api/series/1', {
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));
{
"serieId": 1,
"serieName": "Mobile Suit Gundam",
"universe": {
"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
},
"isActive": true,
"created": "2024-02-11T17:00:29.6279104",
"createdBy": null,
"lastModified": "2024-02-11T17:00:29.6279259",
"lastModifiedBy": null
}
Create a new serie
fetch('https://fakegundamwikiapi.onrender.com/api/series', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_TOKEN_HERE',
'Content-Type': 'application/json'
},
body: JSON.stringify({
'serieName': 'Mobile Suit Gundam',
'universeId' . 1
})
})
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error('Error:', err));
{
"serieId": 1,
"serieName": "Mobile Suit Gundam",
"universe": {
"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
},
"isActive": true,
"created": "2024-02-11T17:00:29.6279104",
"createdBy": null,
"lastModified": "2024-02-11T17:00:29.6279259",
"lastModifiedBy": null
}
Update a serie
fetch('https://fakegundamwikiapi.onrender.com/api/series/1', {
method: 'PUT',
headers: {
'Authorization': 'Bearer YOUR_TOKEN_HERE',
'Content-Type': 'application/json'
},
body: JSON.stringify({
'serieId',1
'serieName': 'Mobile Suit Gundam',
'universeId' . 1
})
})
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error('Error:', err));
{
"serieId": 1,
"serieName": "Mobile Suit Gundam",
"universe": {
"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
},
"isActive": true,
"created": "2024-02-11T17:00:29.6279104",
"createdBy": null,
"lastModified": "2024-02-11T17:00:29.6279259",
"lastModifiedBy": null
}
Delete a serie
fetch('https://fakegundamwikiapi.onrender.com/api/series/1', {
method: 'DELETE',
headers: {
'Authorization': 'Bearer YOUR_TOKEN_HERE',
'Content-Type': 'application/json'
}
});