Skip to content

Commit

Permalink
swapped the createIndex function location
Browse files Browse the repository at this point in the history
  • Loading branch information
arian0zen committed Apr 7, 2023
1 parent c6466a6 commit c90571a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 6 additions & 0 deletions backend/api/postAPI.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ const deleteImage = require("./deleteImage");
const userAPI = require("./userAPI");

const fetchPosts = async () => {
// userModel.createIndexes({ firstname: "text", lastname: "text", username: "text" }).then(()=>{
// console.log("Indexes created");
// }).catch((err)=>{
// console.log("Error creating indexes");
// });
//this needs to be called after droping db
const posts = await Post.find({})
.sort({ createdAt: -1 })
.populate("creator")
Expand Down
6 changes: 0 additions & 6 deletions backend/api/profileAPI.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
const User = require("../models/Users");

const searchProfile = async (searchTerm) => {
// User.createIndexes({ firstname: "text", lastname: "text", username: "text" }).then(()=>{
// console.log("Indexes created");
// }).catch((err)=>{
// console.log("Error creating indexes");
// });
//this needs to be called after droping db
const users = await User.find(
{
$or: [
Expand Down

0 comments on commit c90571a

Please sign in to comment.