-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added first iteration of complex character creation, character delete
- Loading branch information
1 parent
5488c70
commit 052123b
Showing
15 changed files
with
1,975 additions
and
103 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
src/components/characters/CharacterSelect.js → ...nents/characters/CharacterSelectDelete.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,18 @@ | ||
import React from 'react'; | ||
import ReactDOM from 'react-dom'; | ||
import './index.css'; | ||
import App from './App'; | ||
import reportWebVitals from './reportWebVitals'; | ||
import { BrowserRouter as Router } from "react-router-dom" | ||
import * as serviceWorker from './serviceWorker' | ||
import { HeroForge } from './components/HeroForge' | ||
import "./index.css" | ||
|
||
ReactDOM.render( | ||
<React.StrictMode> | ||
<App /> | ||
</React.StrictMode>, | ||
document.getElementById('root') | ||
); | ||
ReactDOM.render(( | ||
<Router> | ||
<HeroForge /> | ||
</Router> | ||
), document.querySelector("#root")) | ||
|
||
// If you want to start measuring performance in your app, pass a function | ||
// to log results (for example: reportWebVitals(console.log)) | ||
// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals | ||
reportWebVitals(); | ||
|
||
// If you want your app to work offline and load faster, you can change | ||
// unregister() to register() below. Note this comes with some pitfalls. | ||
// Learn more about service workers: https://bit.ly/CRA-PWA | ||
serviceWorker.unregister(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
import Settings from "./Settings" | ||
import { fetchIt } from "./Fetch" | ||
import useSimpleAuth from "../hooks/ui/useSimpleAuth" | ||
|
||
// const expandAnimalUser = (animal, users) => { | ||
// animal.animalOwners = animal.animalOwners.map(ao => { | ||
// ao.user = users.find(user => user.id === ao.userId) | ||
// return ao | ||
// }) | ||
|
||
// animal.animalCaretakers = animal.animalCaretakers.map(caretaker => { | ||
// caretaker.user = users.find(user => user.id === caretaker.userId) | ||
// return caretaker | ||
// }) | ||
|
||
// return animal | ||
// } | ||
|
||
export default { | ||
async get(id) { | ||
return await fetchIt(`${Settings.remoteURL}/classes/${id}`) | ||
.then(res => res) | ||
} | ||
, | ||
// async searchByName(query) { | ||
// const users = await OwnerRepository.getAll() //copied the extra code for expansion from get and getall to make sure I could get the full info in the search | ||
// const animals = await fetchIt(`${Settings.remoteURL}/animals?_embed=animalOwners&_embed=treatments&_embed=animalCaretakers&_expand=location&name_like=${query}`) | ||
// .then(data => { | ||
// const embedded = data.map(animal => { | ||
// animal = expandAnimalUser(animal, users) | ||
// return animal | ||
// }) | ||
// return embedded | ||
// }) | ||
// return animals | ||
// }, | ||
// async delete(id) { | ||
// return await fetchIt(`${Settings.remoteURL}/animals/${id}`, "DELETE") | ||
// }, | ||
async getAll() { | ||
return await fetchIt(`${Settings.remoteURL}/classes`) | ||
}, | ||
|
||
|
||
// async addAnimalCaretaker(newAnimalCaretaker) { //added function to add caretakers | ||
// return await fetchIt( | ||
// `${Settings.remoteURL}/animalCaretakers`, | ||
// "POST", | ||
// JSON.stringify(newAnimalCaretaker) | ||
// ) | ||
// }, | ||
// async updateAnimal(editedAnimal) { | ||
// return await fetchIt( | ||
// `${Settings.remoteURL}/animals/${editedAnimal.id}`, | ||
// "PUT", | ||
// JSON.stringify(editedAnimal) | ||
// ) | ||
// } | ||
} |
Oops, something went wrong.