Manufacturers
Get all manufacturers
fetch('https://fakegundamwikiapi.onrender.com/api/manufacturers', {
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));
[
{
"manufacturerId": 1,
"manufacturerName": "Earth Federation",
"isActive": true,
"created": "2024-02-11T16:59:51.6310774",
"createdBy": null,
"lastModified": "2024-02-11T16:59:51.6312354",
"lastModifiedBy": null
},
{
"manufacturerId": 2,
"manufacturerName": "Zeonic Company",
"isActive": true,
"created": "2024-05-06T20:31:19.8051319",
"createdBy": null,
"lastModified": "2024-05-06T20:31:19.8051967",
"lastModifiedBy": null
}
]
Get a single manufacturer
fetch('https://fakegundamwikiapi.onrender.com/api/manufacturers/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));
{
"manufacturerId": 1,
"manufacturerName": "Earth Federation",
"isActive": true,
"created": "2024-02-11T16:59:51.6310774",
"createdBy": null,
"lastModified": "2024-02-11T16:59:51.6312354",
"lastModifiedBy": null
}
Create a new manufacturer
fetch('https://fakegundamwikiapi.onrender.com/api/manufacturers', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_TOKEN_HERE',
'Content-Type': 'application/json'
},
body: JSON.stringify({
'manufacturerName': 'Earth Federation Forces'
})
})
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error('Error:', err));
{
"manufacturerId": 1,
"manufacturerName": "Earth Federation",
"isActive": true,
"created": "2024-02-11T16:59:51.6310774",
"createdBy": null,
"lastModified": "2024-02-11T16:59:51.6312354",
"lastModifiedBy": null
}
Update a manufacturer
fetch('https://fakegundamwikiapi.onrender.com/api/manufacturers/1', {
method: 'PUT',
headers: {
'Authorization': 'Bearer YOUR_TOKEN_HERE',
'Content-Type': 'application/json'
},
body: JSON.stringify({
'manufacturerId' : 1,
'manufacturerName': 'Earth Federation Forces'
})
})
.then(res=>res.json())
.then(json=>console.log(json));
{
"manufacturerId": 1,
"manufacturerName": "Earth Federation",
"isActive": true,
"created": "2024-02-11T16:59:51.6310774",
"createdBy": null,
"lastModified": "2024-02-11T16:59:51.6312354",
"lastModifiedBy": null
}
Active/Inactive a manufacturer
fetch('https://fakegundamwikiapi.onrender.com/api/manufacturers/1', {
method: 'DELETE',
headers: {
'Authorization': 'Bearer YOUR_TOKEN_HERE',
'Content-Type': 'application/json'
},
});;