Skip to content

Commit

Permalink
Merge pull request #218 from a0uda/MessagesFeature
Browse files Browse the repository at this point in the history
new message when creating community added
  • Loading branch information
HebaBoudy authored May 11, 2024
2 parents d60a042 + 363c319 commit 6b617e0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/services/communityService.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,11 @@ const addNewCommunity = async (requestBody, creator) => {
disable_updates: false,
});
await creator.save();
//find the id of the user who is named reddit
const redditUser = await User.findOne({ username: "reddit" });
//add new message to the creator inbox
const message = new Message({
sender_id: new mongoose.Types.ObjectId("66356010be06bf92b669eda3"),
sender_id: redditUser._id,
sender_type: "user",
subject: "You started a reddit community , now what ?:",
receiver_id: creator._id,
Expand Down

0 comments on commit 6b617e0

Please sign in to comment.