fix: include id in vehicle creation response#80
Merged
Conversation
VehicleCreateSerializer was missing the id field, causing POST
/api/v1/vehicles/ to return a response without the created resource's
ID. This broke any client that needs the ID after creation (e.g., FCM
token update via PATCH /api/v1/vehicles/{id}/fcm-token/).
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
VehicleCreateSerializer의fields에id가 누락되어POST /api/v1/vehicles/응답에 생성된 리소스의 ID가 포함되지 않던 버그 수정/api/v1/vehicles/undefined/fcm-token/으로 전송되어 0% 성공률 발생Changes
apps/vehicles/serializers.py:VehicleCreateSerializer.Meta.fields에"id"추가,read_only_fields = ["id"]설정Test plan
POST /api/v1/vehicles/응답에id필드가 포함되는지 확인PATCH /api/v1/vehicles/{id}/fcm-token/정상 동작 확인