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

Fix 404 when call update favorite API #216

Merged
merged 2 commits into from
Oct 2, 2024

Conversation

odkhang
Copy link
Collaborator

@odkhang odkhang commented Oct 2, 2024

This PR fix issue 404 not found when call update favorite session API

How has this been tested?

Checklist

  • I have added tests to cover my changes.

Summary by Sourcery

Fix the 404 error in the update favorite session API by adjusting the URL path to correctly handle the event URL structure.

Bug Fixes:

  • Fix the 404 error when calling the update favorite session API by correcting the URL path construction.

Copy link

sourcery-ai bot commented Oct 2, 2024

Reviewer's Guide by Sourcery

This pull request fixes a 404 error when calling the update favorite API. The main changes involve updating the cache identifier and modifying the API endpoint construction to use the correct base URL.

Sequence diagram for the update favorite API call

sequenceDiagram
    participant User
    participant Frontend
    participant Backend
    User->>Frontend: Click 'Favorite' button
    Frontend->>Backend: POST /api/events/{eventSlug}/favourite-talk/
    Backend-->>Frontend: 200 OK / 404 Not Found
    Frontend-->>User: Show success/error message
Loading

File-Level Changes

Change Details Files
Updated cache identifier in multiple files
  • Changed cache identifier from '5819bc9e-vue-loader-template' to '458f98b2-vue-loader-template'
src/pretalx/static/agenda/js/pretalx-schedule.js
Modified event slug extraction logic
  • Updated the getEventSlug() method to correctly extract the event slug from the URL
src/pretalx/static/agenda/js/pretalx-schedule.js
Updated API endpoint construction for saving favorites
  • Modified the saveFavs() method to construct the correct API endpoint using the base URL
src/pretalx/static/agenda/js/pretalx-schedule.js

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it.

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey @odkhang - I've reviewed your changes - here's some feedback:

Overall Comments:

  • Consider adding a brief comment in the saveFavs method explaining the logic behind constructing the API URL. This could help future maintainers understand the reasoning, especially if the URL structure changes.
Here's what I looked at during the review
  • 🟢 General issues: all looks good
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@mariobehling mariobehling merged commit 4235cc4 into fossasia:development Oct 2, 2024
4 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.

3 participants