Switch UI components to new design system tokens
Standardizes color values and styling using the new tokens: - Replaces hardcoded colors with semantic variables - Updates background/text/border classes for light/dark mode - Migrates inputs to UInput/USelect/UTextarea components - Removes redundant style declarations
This commit is contained in:
parent
9b45652b83
commit
3fea484585
13 changed files with 788 additions and 785 deletions
|
|
@ -2,7 +2,7 @@ import mongoose from "mongoose";
|
|||
|
||||
const eventSchema = new mongoose.Schema({
|
||||
title: { type: String, required: true },
|
||||
slug: { type: String, required: true, unique: true },
|
||||
slug: { type: String, unique: true }, // Auto-generated in pre-save hook
|
||||
tagline: String,
|
||||
description: { type: String, required: true },
|
||||
content: String,
|
||||
|
|
@ -133,7 +133,8 @@ function generateSlug(title) {
|
|||
// Pre-save hook to generate slug
|
||||
eventSchema.pre("save", async function (next) {
|
||||
try {
|
||||
if (this.isNew || this.isModified("title")) {
|
||||
// Always generate slug if it doesn't exist or if title has changed
|
||||
if (!this.slug || this.isNew || this.isModified("title")) {
|
||||
let baseSlug = generateSlug(this.title);
|
||||
let slug = baseSlug;
|
||||
let counter = 1;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue