How can I use same controller functions on two different schemas, with different properties?

I have a user and an admin schema. Both have different properties. I have already defined the controller functions for user, and now I am realising that most of the controller functions for both user and admin are same. I don’t want to code the same logic twice. How can I change my controller functions so that if it is a user signing up only user properties are considered and if an admin is signing up only admin properties are signing. I don’t want to display a choice that would ask a person signing up about whether they are signing up as user or admin.

Currently I’m defining separate controller functions for both user and admin, but most of the code is being reused this way.

Admin Schema:

import  mongoose, { Schema } from 'mongoose'
import pkg from 'validator'

const { isEmail } = pkg;

const adminSchema = new Schema({
    adminId:{
        type: String,
        required: true,
        unique: true,
        length: 10,
    },
    name:{
        type: String,
        required: [true, 'This is a required field'],
    },
    dob:{
        type: Date,
        required: [true, 'This is a required field'],
    },
    email: {
        type: String,
        required: true,
        validator: [isEmail, 'Please enter a valid Email'],
        lowercase: true,
    },
    password:{
        type: String,
        required: [true, 'This is a required Field'],
        validator: [(password)=>pkg.matches(password, "^(?=.*[a-z])(?=.*[A-Z])(?=.*d)(?=.*[@$!%*?&])[A-Za-zd@$!%*?&]{8,}$"),
            "Use special Characters, lower and upper case alphabets and digits"
        ],
    },
})

const Admin = mongoose.model('Admin', adminSchema);
export default Admin;

User Schema:

import mongoose, { Schema } from 'mongoose'
import pkg from 'validator'

const { isEmail } = pkg;
const userSchema = new Schema({
    fullname: {
        type: String,
        required: [true, 'This is a required Field']
    },
    username: {
        type: String,
        required: [true, 'This is a required Field'],
        unique: true,
    },
    email: {
        type: String,
        required: [true, 'This is a required Field'],
        lowercase: true,
        validator: [isEmail, 'Please enter a valid email']
    },
    password: {
        type: String,
        required: [true, 'This is a required Field'],
        validator: [(password)=>pkg.matches(password, "^(?=.*[a-z])(?=.*[A-Z])(?=.*d)(?=.*[@$!%*?&])[A-Za-zd@$!%*?&]{8,}$"),
            "Use special Characters, lower and upper case alphabets and digits"
        ],
    },
})

const User = mongoose.model('User', userSchema);
export default User;

The logic for login and signup Controller functions is mostly same for both models. For example the signup_post method for both Admin and Users is given below

Admin Signup:

const admin_signup_post =  async (req, res)=>{
    try{
        const {name, dob, email, password } = req.body;
        const hashedPwd = await hashedPassword(password);
        const newadminId = createID(name);
        const admin = new Admin({adminId: newadminId, name, dob, email, password: hashedPwd});
        await admin.save();
        res.status(201).json({ admin });

    }catch(err){
        const errors = handleErrors(err);
        res.status(400).json({ errors });
    }
}

User Signup:

const user_signup_post =  async (req, res)=>{
    try{
        const { fullname, username, email, password } = req.body;
        const hashedPwd = await hashedPassword(password);
        const user = new User({fullname, username, email, password: hashedPwd});
        await user.save();
        res.status(201).json({ user });

    }catch(err){
        const errors = handleErrors(err);
        res.status(400).json({ errors });
    }
}