Oleksandr tilnenko day1 drafts#2
Conversation
| - Where and how do we store data (drafts)? | ||
| - Reuse existing table `user_drafts` | ||
| - How to store different drafts (multiple drafts per user)? | ||
| - Change the API endpoint to accept dynamic `draftName` |
There was a problem hiding this comment.
I think we already have it, just need to not hardcode draft name on FE?
| - How to store different drafts (multiple drafts per user)? | ||
| - Change the API endpoint to accept dynamic `draftName` | ||
| - How to get all the drafts? | ||
| - Add a new API endpoint GET to read all the user-related drafts: GET `api/users/<user>/drafts |
| - How to get all the drafts? | ||
| - Add a new API endpoint GET to read all the user-related drafts: GET `api/users/<user>/drafts | ||
|
|
||
| - How will the feature work (behavior)? |
There was a problem hiding this comment.
would be great to have some more details here. E.g. how do we edit the name? do we delete the draft on that separate page or on the editor? This currently looks like a list of "things to do", but it would be great to see more "UX decisions" instead.
| @ApiBody({ | ||
| description: | ||
| 'Arbitrary JSON draft parameters. This can be any JSON object.', | ||
| 'Draft data with optional newName for renaming or params for updating content.', |
There was a problem hiding this comment.
Interesting decision :) Would like to see this as part of technical design, e.g. something like "allow renaming drafts by passing optional new name in PUT request".
| taxPercent: 19, | ||
| currency: 'USD', | ||
| properties: { | ||
| newName: { |
There was a problem hiding this comment.
not sure this is a good way to do it. I would do one of two things:
- switch to ids to identify the drafts instead of names, and then make name just part of draft details (updatable)
- OR, keep using names as unique identifiers and in case of "updating" it just DELETE the "old" draft and PUT a new one with a new name
There was a problem hiding this comment.
i thought about this and i would use ids in real project, but in this case and because i'm a little bit lazy (= i've chosen kostyl, kinda)
a4747cf to
59c9103
Compare
No description provided.