Skip to content

Commit

Permalink
Merge branch 'react-testing' of https://github.com/unb-mds/2024-1-Squ…
Browse files Browse the repository at this point in the history
…ad08 into react-testing
  • Loading branch information
pedroeverton217 committed Aug 27, 2024
2 parents b6a2990 + 5c47081 commit 6dc346c
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 1 deletion.
17 changes: 17 additions & 0 deletions api.js → server/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ app.get('/api/v1/rooms/:id', (req, res) => {
});

// Create one room
<<<<<<< HEAD:api.js
app.post('/api/v1/rooms', async (req, res) => {
const { nome, cep, complemento, numero, emaildono } = req.body;

Expand All @@ -83,6 +84,22 @@ app.post('/api/v1/rooms', async (req, res) => {
console.error("Erro ao criar república:", err);
res.status(500).json({ message: "Erro ao criar república" });
}
=======
app.post("/api/v1/rooms", async (req, res) => {
try {

console.log(req.body);
res.status(201).json({
status: "success",
data: {
room: "005"
}
});
} catch (error) {
console.log(error)
}

>>>>>>> 5c470814ba8467269c247d089103971758e6ef86:server/api.js
});


Expand Down
5 changes: 5 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,8 @@ root.render(
// to log results (for example: reportWebVitals(console.log))
// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
reportWebVitals();

const express = require('express');
const server = express();
const pool = require("./databasescripts/db");

4 changes: 3 additions & 1 deletion src/utils/cpf.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,6 @@ function verifyCpf(somecpf) {
else {
return false
}
};
};

export default verifyCpf;

0 comments on commit 6dc346c

Please sign in to comment.