Skip to content

Oleksandr tilnenko day1 drafts#2

Open
AlexTilnenko wants to merge 3 commits into
AlexSugak:day1-draftsfrom
AlexTilnenko:oleksandr-tilnenko-day1-drafts
Open

Oleksandr tilnenko day1 drafts#2
AlexTilnenko wants to merge 3 commits into
AlexSugak:day1-draftsfrom
AlexTilnenko:oleksandr-tilnenko-day1-drafts

Conversation

@AlexTilnenko

Copy link
Copy Markdown

No description provided.

Comment thread notes.md
- 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`

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we already have it, just need to not hardcode draft name on FE?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

exactly, my bad

Comment thread notes.md
- 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

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Comment thread notes.md
- 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)?

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.',

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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: {

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)

@AlexSugak AlexSugak force-pushed the day1-drafts branch 3 times, most recently from a4747cf to 59c9103 Compare September 16, 2025 17:54
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.

3 participants