Skip to content

Feature/116 webinars backend - #122

Open
achneerov wants to merge 11 commits into
developfrom
feature/116-webinars-backend
Open

Feature/116 webinars backend#122
achneerov wants to merge 11 commits into
developfrom
feature/116-webinars-backend

Conversation

@achneerov

@achneerov achneerov commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

Closes #116

Overview

Make webinars table in DB (was already done) and backend actions (also added schema evaluation in zod)

Testing

Made a dummy page and tested all three endpoints create, modify and delete.

Screenshots / Screencasts

none

Checklist

  • Code is neat, readable, and works
  • Code is commented where appropriate and well-documented
  • Commit messages follow our guidelines
  • Issue number is linked
  • Branch is linked
  • Reviewers are assigned (one of your tech leads)

Tip: You can make the issue and then check them after the fact or replace [ ] with [x] to check it!

@martin0024 martin0024 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good pr alex

Comment thread app/(authenticated)/webinars/schema.ts Outdated
Comment thread app/(authenticated)/webinars/schema.ts Outdated
Comment thread app/(authenticated)/webinars/schema.ts Outdated
Comment thread app/(authenticated)/webinars/actions.ts Outdated
Comment thread app/(authenticated)/webinars/actions.ts Outdated
Comment thread app/(authenticated)/webinars/actions.ts Outdated
Comment thread app/(authenticated)/webinars/actions.ts Outdated
Comment thread app/(authenticated)/webinars/actions.ts Outdated
Comment thread app/(authenticated)/webinars/actions.ts Outdated
Comment on lines +5 to +23
const youtubeUrlSchema = z
.string()
.url("Enter a valid YouTube URL")
.refine(
(value) => {
try {
const hostname = new URL(value).hostname.toLowerCase();
return [
"youtube.com",
"www.youtube.com",
"youtu.be",
"www.youtu.be",
].includes(hostname);
} catch {
return false;
}
},
{ message: "URL must be a YouTube URL" },
);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const youtubeUrlSchema = z
.string()
.url("Enter a valid YouTube URL")
.refine(
(value) => {
try {
const hostname = new URL(value).hostname.toLowerCase();
return [
"youtube.com",
"www.youtube.com",
"youtu.be",
"www.youtu.be",
].includes(hostname);
} catch {
return false;
}
},
{ message: "URL must be a YouTube URL" },
);
const youtubeUrlSchema = z
.string()
.url("Enter a valid YouTube URL")
.refine(
(value) => {
const hostname = new URL(value).hostname.toLowerCase();
return [
"youtube.com",
"www.youtube.com",
"youtu.be",
"www.youtu.be",
].includes(hostname);
},
{ message: "URL must be a YouTube URL" },
);

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dude I tried that before and it lowkey crashes because if const hostname = new URL(value).hostname.toLowerCase(); fails then this crashes:
return [
"youtube.com",
"www.youtube.com",
"youtu.be",
"www.youtu.be",
].includes(hostname);

achneerov and others added 9 commits August 15, 2026 20:14
alright

Co-authored-by: ϻartin <51332188+martin0024@users.noreply.github.com>
Signed-off-by: Alexander Chneerov <123044733+achneerov@users.noreply.github.com>
Co-authored-by: ϻartin <51332188+martin0024@users.noreply.github.com>
Signed-off-by: Alexander Chneerov <123044733+achneerov@users.noreply.github.com>
Co-authored-by: ϻartin <51332188+martin0024@users.noreply.github.com>
Signed-off-by: Alexander Chneerov <123044733+achneerov@users.noreply.github.com>
Co-authored-by: ϻartin <51332188+martin0024@users.noreply.github.com>
Signed-off-by: Alexander Chneerov <123044733+achneerov@users.noreply.github.com>
Co-authored-by: ϻartin <51332188+martin0024@users.noreply.github.com>
Signed-off-by: Alexander Chneerov <123044733+achneerov@users.noreply.github.com>
Co-authored-by: ϻartin <51332188+martin0024@users.noreply.github.com>
Signed-off-by: Alexander Chneerov <123044733+achneerov@users.noreply.github.com>
Co-authored-by: ϻartin <51332188+martin0024@users.noreply.github.com>
Signed-off-by: Alexander Chneerov <123044733+achneerov@users.noreply.github.com>
Co-authored-by: ϻartin <51332188+martin0024@users.noreply.github.com>
Signed-off-by: Alexander Chneerov <123044733+achneerov@users.noreply.github.com>
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