Csrinru Forums - Verified

const forumSchema = new mongoose.Schema({ name: String, description: String, verified: { type: Boolean, default: false } });

module.exports = mongoose.model('Forum', forumSchema); // controllers/ForumController.js const express = require('express'); const router = express.Router(); const Forum = require('../models/Forum'); csrinru forums verified

module.exports = router; <!-- Display Verification Badge --> <div *ngIf="forum.verified"> <i class="verified-badge">Verified</i> </div> const forumSchema = new mongoose

// models/Forum.js const mongoose = require('mongoose'); verified: { type: Boolean

router.get('/:id', async (req, res) => { try { const forum = await Forum.findById(req.params.id); res.json(forum); } catch (err) { res.status(404).json({ message: 'Forum not found' }); } });

SON

A Blogger, Social Media Enthusiast, Music Lover, Ideator,Digital Marketer & Publicist who loves God.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Back to top button