From c29246e8d078be00cf34f2504f4464f5920e404c Mon Sep 17 00:00:00 2001 From: Petter Hohle Date: Tue, 26 Nov 2024 09:32:53 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=91=8C=20Address=20Ane's=20comments=20Add?= =?UTF-8?q?=20validations=20Rename=20field?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- studio/schemas/documents/admin/jobPostings.ts | 2 +- studio/schemas/objects/jobPosting.ts | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/studio/schemas/documents/admin/jobPostings.ts b/studio/schemas/documents/admin/jobPostings.ts index 146a9f6d2..ecc3c09c9 100644 --- a/studio/schemas/documents/admin/jobPostings.ts +++ b/studio/schemas/documents/admin/jobPostings.ts @@ -10,7 +10,7 @@ const jobPostings = defineType({ title: "Job Postings", fields: [ { - name: "jobPostings", + name: "jobPostingsArray", title: "Job Postings", type: "array", of: [{ type: jobPostingID }], diff --git a/studio/schemas/objects/jobPosting.ts b/studio/schemas/objects/jobPosting.ts index 4f705804a..0bee369a9 100644 --- a/studio/schemas/objects/jobPosting.ts +++ b/studio/schemas/objects/jobPosting.ts @@ -15,6 +15,7 @@ const jobPosting = defineType({ name: "role", type: "internationalizedArrayString", description: "The name of the role", + validation: (rule) => [rule.required().error("Role name is required")], }, { title: "Location", @@ -27,7 +28,13 @@ const jobPosting = defineType({ title: "Recruitee ad URL", name: "recruiteeAdUrl", type: "url", - description: "URL to Recruitee ad", + description: + "URL to Recruitee ad. Please enter the full URL, including 'https://', e.g., 'https://www.example.com'.", + validation: (rule) => + rule.uri({ + scheme: ["http", "https"], + allowRelative: false, + }), }, ], preview: {