Skip to content

Claim matching quests after post submission#27

Merged
Driedoutjerky merged 13 commits into
mainfrom
feat/refactor-post
Jun 9, 2026
Merged

Claim matching quests after post submission#27
Driedoutjerky merged 13 commits into
mainfrom
feat/refactor-post

Conversation

@Driedoutjerky

Copy link
Copy Markdown
Owner

NOTE: PR #26 should be merged to main in prior to this pull request.

Summary

This PR updates the frontend post submission flow to support post-based quest claiming.

After a user submits a post, the frontend now:

  1. creates the post
  2. reads the created post id
  3. filters today's assigned/unclaimed quests that the post likely satisfies
  4. sends quest claim requests with { post_id }
  5. refreshes user/quest data

Changes

  • Added quest matching helper for frontend-side candidate filtering.
  • Updated questsApi to support post-based quest claim payloads.
  • Updated useQuests to expose claimQuestForPost({ userQuestId, postId }).
  • Updated WritePostPage to claim likely matching quests after post creation.
  • Kept backend verification as the source of truth.

Notes

Frontend only filters likely matching quests to avoid unnecessary claim requests.
Backend still verifies the actual quest condition before granting rewards.

Test Plan

  • Run npm run build
  • Run npm run lint
  • Submit a post with a matching tag quest
  • Confirm matching quest becomes claimed
  • Confirm Will reward increases
  • Submit a post that does not match any quest
  • Confirm no quest is claimed
  • Confirm post submission still succeeds even if a quest claim fails

@Driedoutjerky Driedoutjerky merged commit 011e1e3 into main Jun 9, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants