mirror of
https://github.com/alkimake/paperclip.git
synced 2026-06-14 18:10:39 +09:00
Add feedback voting and thumbs capture flow
Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
parent
3db6bdfc3c
commit
c0d0d03bce
66 changed files with 18988 additions and 78 deletions
22
packages/shared/src/validators/feedback.ts
Normal file
22
packages/shared/src/validators/feedback.ts
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
import { z } from "zod";
|
||||
import {
|
||||
FEEDBACK_DATA_SHARING_PREFERENCES,
|
||||
FEEDBACK_TARGET_TYPES,
|
||||
FEEDBACK_TRACE_STATUSES,
|
||||
FEEDBACK_VOTE_VALUES,
|
||||
} from "../types/feedback.js";
|
||||
|
||||
export const feedbackTargetTypeSchema = z.enum(FEEDBACK_TARGET_TYPES);
|
||||
export const feedbackTraceStatusSchema = z.enum(FEEDBACK_TRACE_STATUSES);
|
||||
export const feedbackVoteValueSchema = z.enum(FEEDBACK_VOTE_VALUES);
|
||||
export const feedbackDataSharingPreferenceSchema = z.enum(FEEDBACK_DATA_SHARING_PREFERENCES);
|
||||
|
||||
export const upsertIssueFeedbackVoteSchema = z.object({
|
||||
targetType: feedbackTargetTypeSchema,
|
||||
targetId: z.string().uuid(),
|
||||
vote: feedbackVoteValueSchema,
|
||||
reason: z.string().trim().max(1000).optional(),
|
||||
allowSharing: z.boolean().optional(),
|
||||
});
|
||||
|
||||
export type UpsertIssueFeedbackVote = z.infer<typeof upsertIssueFeedbackVoteSchema>;
|
||||
Loading…
Add table
Add a link
Reference in a new issue