Affiliations


Get all affiliations

        
fetch('https://fakegundamwikiapi.onrender.com/api/affiliations', {
  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));
         
    

Get a single affiliation

        
fetch('https://fakegundamwikiapi.onrender.com/api/affiliations/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));
         
    

Create a new affiliation

        
fetch('https://fakegundamwikiapi.onrender.com/api/affiliations', {
    method: 'POST',
    headers: {
        'Content-Type': 'application/json'
    },
    body: JSON.stringify({
        'affiliationName': 'Earth Federation Forces',
        'affiliationPurpose': 'Military Organization'
    })
})
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error('Error:', err));;
         
    

Update a affiliation

        
fetch('https://fakegundamwikiapi.onrender.com/api/affiliations/1', {
    method: 'PUT',
    headers: {
        'Authorization': 'Bearer YOUR_TOKEN_HERE',
        'Content-Type': 'application/json'
    },
    body: JSON.stringify({
        'affiliationId': 1,
        'affiliationName': 'Earth Federation Forces',
        'affiliationPurpose': 'Military Organization'
    })
})
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error('Error:', err));
         
    

Active/Inactive a affiliation

        
fetch('https://fakegundamwikiapi.onrender.com/api/affiliations/1', {
  method: 'DELETE',
  headers: {
        'Authorization': 'Bearer YOUR_TOKEN_HERE',
        'Content-Type': 'application/json'
    },
});;