gostack-template-reactjs-crud
Esse projeto está sob a licença MIT. Veja o arquivo LICENSE para mais detalhes.
Feito com 💜 by Rocketseat
gostack-template-reactjs-crud
Esse projeto está sob a licença MIT. Veja o arquivo LICENSE para mais detalhes.
Feito com 💜 by Rocketseat
Variable debug is unused;
const { getByText, getByTestId, getByPlaceholderText, >debug< } = render(
<Dashboard />,
);
Some others variables referencing a property that doesn't exists on HTMLElement.
const inputImage = getByPlaceholderText('Cole o link aqui');
expect(inputImage.>value<).toBe('http://rocketseat.com.br');
The following code at Food/index.ts would make the test pass:
async function toggleAvailable(): Promise<void> {
setIsAvailable(!isAvailable)
}
But if you reload the page, the state is not maintained because there isn't any api call to update food availability.
At the begining of the bootcamp, Diego has been reinforce the difference between this two methods and its applications. For me, in this case PATCH makes much more sense than PUT because I'm changing only the "available" attribute of the food resource, not all the resource.
But if you try to use PATCH to toggle the available status, the tests will return error 404, otherwise if you goes to use PUT, everthing will be ok and the test will return success.
According Mozilla.org:
The HTTP PUT request method creates a new resource or replaces a representation of the target resource with the request payload. (https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/PUT)
The HTTP PATCH request method applies partial modifications to a resource. https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/PATCH
There is a reason to use PUT in this case?
Regards.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.