feat(storefront): update FAQ and legal documentation
- Added new FAQ sections for account security, ordering and checkout, returns, shipping, and contact information. - Introduced legal documents including privacy policy, terms of service, data protection, and general terms and conditions. - Updated package dependencies to include gray-matter and remark-gfm for enhanced markdown support.
This commit is contained in:
32
convex/messages.ts
Normal file
32
convex/messages.ts
Normal file
@@ -0,0 +1,32 @@
|
||||
import { mutation } from "./_generated/server";
|
||||
import { v } from "convex/values";
|
||||
|
||||
const topicValidator = v.union(
|
||||
v.literal("products"),
|
||||
v.literal("orders"),
|
||||
v.literal("support"),
|
||||
v.literal("other"),
|
||||
);
|
||||
|
||||
/**
|
||||
* Public mutation: submit a contact message. No auth required.
|
||||
*/
|
||||
export const submit = mutation({
|
||||
args: {
|
||||
fullName: v.string(),
|
||||
email: v.string(),
|
||||
topic: topicValidator,
|
||||
message: v.string(),
|
||||
},
|
||||
handler: async (ctx, args) => {
|
||||
const now = Date.now();
|
||||
return await ctx.db.insert("messages", {
|
||||
fullName: args.fullName,
|
||||
email: args.email,
|
||||
topic: args.topic,
|
||||
message: args.message,
|
||||
createdAt: now,
|
||||
bookmarked: false,
|
||||
});
|
||||
},
|
||||
});
|
||||
Reference in New Issue
Block a user