Skip to content

Grow #17

@Feven98

Description

@Feven98
  • The first one will be adding owner field to our post schema so the person who post can only delete or edit the post he created.
  • The second one is adding authentication. We tried to implement it in the code but because we are getting errors we removed that one.
const userSchema = new mongoose.Schema(
  {
    username: {
      type: String,
      required: true,
      unique: true,
    },
    password: {
      type: String,
      required: true,
    },
  },
  {
    timestamps: true,
    id: false,
    toJSON: {
        virtuals: true,
        transform: (_doc, ret) => {
            delete ret.password
            return ret
        }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions