Git Product home page Git Product logo

info-demo's Introduction

Application for Managing Owned Item

Setup

Clone

git clone https://github.com/12ev09/info-demo.git

Install based on package.json

npm i

Setting application id by rakuten api

  • Registering a new application and Get application id here

  • Create env file and define application id like as described below

REACT_APP_APPLICATION_ID={YOUR_APPLICATION_ID}

setup json server

cp db_example.json db.json

Makefile

make json

Start server

npm start

Makefile

make start

Start JSON server

npm run json-server

Makefile

make db

info-demo's People

Contributors

12ev09 avatar bata-yas avatar

Stargazers

Shota Minegishi avatar

Watchers

 avatar

info-demo's Issues

テーブルを表示するページの作成

入力確定後のデータを表示

  • 何を表示する?
  • 商品画像を出す?
  • content typeごとにグルーピングして表示?
  • 削除とか再編集できるようにする?

テーブルの指定した1行を削除する機能を追加

What

現状、レコードをブラウザ上で削除できない

##. How

  • テーブルのカラムに削除ボタンを追加
  • ボタンに紐づける処理をかく
const deleteRecord(id) = ()=>{
    const uri = 'http://localhost:3001/items/'+id
            axios.delete(uri).then()
}

↑雑な例

テーブル作成

const ItemTable = () => {

        const [data, setData] = useState([])

        const createTable = () => {
                axios.get('http://localhost:3001/items')
                        .then(function (response) {
                                setData(response.data)
                        })
                        .catch(function (error) {
                                console.log(error);
                        });
        }

        // TODO: ページを更新したら実行-> dbに追加したら
        useEffect(() => {
                createTable()
        }, [])

        return (
                <Table striped celled>
                        <Table.Header>
                                <Table.Row>
                                        <Table.HeaderCell>ID</Table.HeaderCell>
                                        <Table.HeaderCell>Title</Table.HeaderCell>
                                        <Table.HeaderCell>Author</Table.HeaderCell>
                                </Table.Row>
                        </Table.Header>
                        <Table.Body>
                                {data.map(({ id, title, author }) => (
          return
                                        <Table.Row>
                                                <Table.Cell>{id}</Table.Cell>
                                                <Table.Cell>{title}</Table.Cell>
                                                <Table.Cell>{author}</Table.Cell>
                                        </Table.Row>
                                )))}
                        </Table.Body>
                </Table>
        );
}

楽天APIに送るクエリのフォームを作成

What

現状、決まった本のJANコードをクエリとして送っている状況

How

既存のフォームと同様のデザインで必要な入力欄をもつフォームを作成
新しく状態を持つことが必要だが、既存のフォームの処理を参照すると良い

必要最低限のセットアップ

やるべきこと

  • README.mdに環境を構築する手順の記載
    • 楽天developersでappliction_idを取得する方法
    • 起動方法
  • 必要なパッケージをpackage.jsonに一通り記載

備考

楽天developersによって本などの検索はできるが、クエリはUTF-8でエンコードする必要あり

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.