Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

/items 実装 #4

Merged
merged 6 commits into from
Mar 27, 2024
Merged

/items 実装 #4

merged 6 commits into from
Mar 27, 2024

Conversation

s9-sukyu
Copy link
Collaborator

No description provided.

@s9-sukyu
Copy link
Collaborator Author

s9-sukyu commented Mar 21, 2024

現状で困っているところ
GET /api/items/1 でこれが取得できる(正常, GET /api/items/{id}は正常に動く)

{
    "id": 1,
    "createdAt": "2024-03-21T20:28:55.789+09:00",
    "updatedAt": "2024-03-21T20:28:55.789+09:00",
    "name": "テスト 本",
    "description": "テスト 本",
    "imgUrl": "https://cover.openbd.jp/9784041026403.jpg",
    "book": {
        "createdAt": "2024-03-21T20:28:55.789+09:00",
        "updatedAt": "2024-03-21T20:28:55.789+09:00",
        "itemId": 1,
        "code": "9784041026403"
    }
}

GET /api/items を叩くとこうなって、bookとequipmentが取得できない 本当はbookとequipmentも取得したい

[
    {
        "id": 1,
        "createdAt": "2024-03-21T20:28:55.789+09:00",
        "updatedAt": "2024-03-21T20:28:55.789+09:00",
        "name": "テスト 本",
        "description": "テスト 本",
        "imgUrl": "https://cover.openbd.jp/9784041026403.jpg"
    },
    {
        "id": 2,
        "createdAt": "2024-03-21T20:29:39.787+09:00",
        "updatedAt": "2024-03-21T20:29:39.787+09:00",
        "name": "テスト 備品でも本でもない",
        "description": "テスト 備品でも本でもない",
        "imgUrl": "https://aaa.jp/1.jpg"
    },
...

@s9-sukyu
Copy link
Collaborator Author

book, equipmentのpreloadを忘れていただけだった

@s9-sukyu s9-sukyu changed the title draft: /items 実装 /items 実装 Mar 27, 2024
@s9-sukyu s9-sukyu marked this pull request as ready for review March 27, 2024 08:35
@s9-sukyu s9-sukyu merged commit 9c75770 into main Mar 27, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants