Skip to content

6 endpoint do dodawania gatunku#18

Open
RaidenPL wants to merge 12 commits intomasterfrom
6-endpoint-do-dodawania-gatunku
Open

6 endpoint do dodawania gatunku#18
RaidenPL wants to merge 12 commits intomasterfrom
6-endpoint-do-dodawania-gatunku

Conversation

@RaidenPL
Copy link
Copy Markdown
Collaborator

@RaidenPL RaidenPL commented Dec 2, 2023

No description provided.

@RaidenPL RaidenPL linked an issue Dec 2, 2023 that may be closed by this pull request
{
return NotFound();
}
return Ok();
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.

powinno byc w srodku bloku try

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.

do wyjebki

public void Add(Genre entity)
{
_context.Genres.Add(entity);
_context.Add(entity);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

wystarczy _context.Genres.Add(..)

{
Genre? genre = _context.Genres.Find(id) ?? throw new NotFoundException("Genre "+id+" not found in repository");
return genre;
throw new NotImplementedException();
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

wyjeb

{

public ICollection<int> genres_ids { get; set; }
[JsonIgnore]
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Po co to ?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

request do kontrolera książki który do isniejącej książki dodaje gatunki

public ActionResult Put(int id, [FromBody] AssigneGenreToBookRequest request)
{
request.book_id = id;
_bookService.assigneGenre(request);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

nie musisz w requescie miec pola book_id, powinno byc tak ze serwis assigneGenre przyjmuje request i samo id jako parametry

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.

Endpoint do dodawania gatunku

3 participants