-
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.
Update and Delete methods added in DevController + routes.js and a ne…
…w component (UpdateTechs) was created in web.
- Loading branch information
Showing
17 changed files
with
583 additions
and
118 deletions.
There are no files selected for viewing
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 |
---|---|---|
|
@@ -14,7 +14,8 @@ setupWebsocket(server); | |
mongoose.connect('mongodb+srv://omnistack:[email protected]/omnistack10', | ||
{ | ||
useNewUrlParser: true, | ||
useUnifiedTopology: true | ||
useUnifiedTopology: true, | ||
useFindAndModify: false | ||
} | ||
); | ||
|
||
|
@@ -28,7 +29,7 @@ app.use(routes); | |
|
||
// Query Params: request.query (Filtros, odenação, paginação, ...) | ||
// Route Params: request.params (Identificar um recurso na alteração ou remoção) | ||
// Body Params: request.body (Dados para criação ou alteração de um registro) | ||
// Body Params: request.body (Dados para criação ou alteração de um registro) | ||
|
||
|
||
server.listen(3333); |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,57 +1,11 @@ | ||
import React, { useState, useEffect } from 'react'; | ||
import React from 'react'; | ||
|
||
import './App.css'; | ||
import './global.css'; | ||
import './Sidebar.css'; | ||
import './Main.css'; | ||
|
||
import api from './services/api'; | ||
|
||
import DevItem from './components/DevItem'; | ||
import DevForm from './components/DevForm'; | ||
|
||
function App() { | ||
|
||
const [ devs, setDevs ] = useState([]); | ||
|
||
useEffect(() => { | ||
async function loadDevs(){ | ||
const response = await api.get('/devs') | ||
setDevs(response.data); | ||
} | ||
loadDevs(); | ||
}, []); | ||
|
||
async function handleAddDev(data){ | ||
|
||
const response = await api.post('/devs', data); | ||
|
||
setDevs([...devs, response.data]); | ||
} | ||
|
||
|
||
return ( | ||
<div id="app"> | ||
<aside> | ||
<strong>Cadastrar</strong> | ||
<DevForm onSubmit={handleAddDev}/> | ||
</aside> | ||
|
||
<main> | ||
|
||
<ul> | ||
{ | ||
devs.map(dev => ( | ||
<DevItem key={dev._id} dev={dev} /> | ||
)) | ||
} | ||
</ul> | ||
|
||
</main> | ||
|
||
</div> | ||
); | ||
import Routes from './components/routes'; | ||
|
||
function App(){ | ||
return ( | ||
<Routes /> | ||
) | ||
} | ||
|
||
export default App; | ||
export default App; |
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
Oops, something went wrong.