Git Product home page Git Product logo

task-react-axios-fe's Introduction

Chatting website

First things first:

  1. fork
  2. clone
  3. cd to the folder
  4. npm install
  5. npm start

Instructions

  1. Install Axios npm install axios
  2. in App.js import axios from "axios"

Fetch rooms :

  1. a state for rooms is created for you in App.js
  2. in App.js create a fetchRooms function ( make sure to use : async , await, try and catch )
  3. fetchRooms should be triggred once App is rendered
  4. dont forget to setRooms based on the response

Create a room:

  1. a createRoom function has been created in App.js
  2. pass it to ChatRoomList component
  3. then pass it to CreateRoomModel component
  4. in CreateRoomModel a room state has been created for you
  5. fix the missing code in : handleChange, handleSubmit (read the comments they have hints)
  6. in App.js complete createRoom function ( make sure to use : async , await, try and catch )
  7. dont forget to add the new room to the list of rooms

Delete a room :

  1. a deleteRoom function has been created in App.js
  2. pass it to ChatRoomList component
  3. then pass it to ChatRoomitem component
  4. in ChatRoomitem fix the missing code in : handleDelete (read the comments they have hints)
  5. in App.js complete deleteRoom function ( make sure to use : async , await, try and catch )
  6. dont forget to delete the room from the list of rooms

Challenge

Update , Create a msg:

no steps ! its a challenge

here are all the APIs:

Endpoints:
Fetch all rooms:
Endpoint: https://coded-task-axios-be.herokuapp.com/rooms
GET

Create a room:
Endpoint: https://coded-task-axios-be.herokuapp.com/rooms
Method: POST
Data required: title,image,description

Update a room:
Endpoint: https://coded-task-axios-be.herokuapp.com/rooms/${roomId}
Method: PUT
Data required: title,image,description

Delete a room:
Endpoint: https://coded-task-axios-be.herokuapp.com/rooms/${roomId}
Method: Delete

Create a msg:
Endpoint: https://coded-task-axios-be.herokuapp.com/rooms/msg/${roomId}
Method: POST
Data required: msg

task-react-axios-fe's People

Contributors

zainabbaq avatar tahernaqi avatar yanalshmilan avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.