'I am trying to do a search filter with mongo and api, but it getting error

I am trying to search a file when I type something in the form. first I do POST and save it, then in the other form, I search , if the input is equal that I have in the database, I fecth it, else It do nothing .

I am getting "not find" when I execute it in postman. Can someone help me? I aprecciate

const router = require("express").Router();
const Post = require ("../models/Post");

router.get("/" ,async (req,res ) => {
    try {
        const findPost = await Post.findOne(); 
        
            if ( req.body.post === findPost) {
                res.status(200).json(findPost);
            } else {
                res.status(401).json("not find")
            }

        
    } catch {
        res.status(500).json("not correct");
    }

this is the post Schema

const mongoose = require("mongoose")

const PostSchema = new mongoose.Schema({
    post: {
        type: String,
        required: true,
    }
}, {timestamps: true});

module.exports = mongoose.model("Post", PostSchema)


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source