Skip to content

Conversation

@Dhruwang
Copy link
Member

What does this PR do?

Fixes Source tracking

We recently merged source tracking PR but somehow, it broke
Even if you provide source into URL, it was not getting saved

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • Chore (refactoring code, technical debt, workflow improvements)
  • Enhancement (small improvements)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change adds a new database migration
  • This change requires a documentation update

Checklist

Required

  • Filled out the "How to test" section in this PR
  • Read How we Code at Formbricks
  • Self-reviewed my own code
  • Commented on my code in hard-to-understand bits
  • Ran pnpm build
  • Checked for warnings, there are none
  • Removed all console.logs
  • Merged the latest changes from main onto my branch with git pull origin main
  • My changes don't cause any responsiveness issues
  • First PR at Formbricks? Please sign the CLA! Without it we wont be able to merge it 🙏

Appreciated

  • If a UI change was made: Added a screen recording or screenshots to this PR
  • Updated the Formbricks Docs if changes were necessary

@vercel
Copy link

vercel bot commented Oct 28, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

2 Ignored Deployments
Name Status Preview Updated (UTC)
formbricks-cloud ⬜️ Ignored (Inspect) Oct 28, 2023 7:58am
formbricks-com ⬜️ Ignored (Inspect) Oct 28, 2023 7:58am

@github-actions
Copy link
Contributor

Thank you for following the naming conventions for pull request titles! 🙏

@review-agent-prime
Copy link
Contributor

The changes in the PR look good and make the code cleaner by directly passing the responseInput object to the makeRequest function. However, I would suggest to also apply the same change to the update method for consistency. Here is how you can do it:

async update(responseUpdateInput: TResponseUpdateInputWithResponseId): Promise<Result<TResponse, NetworkError | Error>> {
    const { responseId, ...updateData } = responseUpdateInput;
    return makeRequest(this.apiHost, `/api/v1/client/responses/${responseId}`, "PUT", updateData);
}

In this way, you destructure the responseUpdateInput object to separate responseId from the rest of the data, and then pass the remaining data (updateData) to the makeRequest function. This keeps the code consistent with the changes you made in the create method.

@jobenjada jobenjada added this pull request to the merge queue Oct 28, 2023
@jobenjada
Copy link
Member

good job! :)

Merged via the queue into main with commit cf938bf Oct 28, 2023
@jobenjada jobenjada deleted the source-tracking-issue branch October 28, 2023 14:37
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