-
Notifications
You must be signed in to change notification settings - Fork 1k
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: Response card issues #1957
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 2 Ignored Deployments
|
Thank you for following the naming conventions for pull request titles! 🙏 |
packages/ui/SingleResponseCard/index.tsxThe function function isNonEmptyString(value: any) {
return typeof value === "string" && value.trim() !== "";
}
function isNonEmptyArray(value: any) {
return Array.isArray(value) && value.length > 0;
}
function isNumber(value: any) {
return typeof value === "number";
}
function isValidValue(value: any) {
return isNonEmptyString(value) || isNonEmptyArray(value) || isNumber(value);
}
packages/ui/SingleResponseCard/actions.tsConsider using a more descriptive error message when throwing an AuthorizationError. This will help in debugging and understanding the context of the error. Also, consider extracting the authorization check into a separate function to improve readability and maintainability. export const deleteTagOnResponseAction = async (responseId: string, tagId: string, surveyId: string) => {
const session = await getServerSession(authOptions);
if (!session) throw new AuthorizationError("Not authorized");
await checkAuthorization(session.user!.id, tagId, responseId);
const tag = await getTag(tagId);
const { hasDeleteAccess } = await verifyUserRoleAccess(tag!.environmentId, session.user!.id);
if (!hasDeleteAccess) throw new AuthorizationError("Not authorized");
return await deleteTagOnResponse(responseId, tagId, surveyId);
};
|
…s into response-note-issue
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Dhruwang seems like everything's working now 😊💪🔥 Let's merge this and get the release ready 🚀
What does this PR do?
Fixes
Deleted response not being removed from response list (1710)
Changes in response note not being reflected (1745)
Changes in tags not being reflected
How should this be tested?
Delete Response
Play with response notes
Response tags
Checklist
Required
pnpm build
console.logs
git pull origin main
Appreciated