Skip to content
Snippets Groups Projects
Commit cac7a8ae authored by Ludvig Damberg's avatar Ludvig Damberg
Browse files

session

created routes for
deleting posts
fetching profile posts
saving profile information to posts
loading animation
ect.
parent d7e37abc
No related branches found
No related tags found
No related merge requests found
Showing
with 48 additions and 13 deletions
const mongoose = require('mongoose')
const userModel = require('./user')
const postSchema = new mongoose.Schema({
name:{
type:String,
required:true
name: {
type: String,
required: true
},
recipe:{
type:String,
required:false
recipe: {
type: [String],
required: false
},
description:{
type:String,
required:true
description: {
type: String,
required: true
},
photo:{
author:{
type: mongoose.Schema.Types.ObjectId,
ref:"user"
},
profile_picture: {
type: String,
required: false
required: true
},
profile_name: {
type: String,
required: true
},
photo: {
type: String,
required: true
}
})
const postModel = mongoose.model("Post",postSchema)
const postModel = mongoose.model("Post", postSchema)
module.exports = postModel
......@@ -18,6 +18,11 @@ password:{
type:String,
required: true
},
posts: {
type: mongoose.SchemaTypes.ObjectId,
ref: "post",
required: false
},
photo:{
type: String,
required: false
......
......@@ -671,6 +671,11 @@
"node": ">= 0.6"
}
},
"node_modules/fs": {
"version": "0.0.1-security",
"resolved": "https://registry.npmjs.org/fs/-/fs-0.0.1-security.tgz",
"integrity": "sha512-3XY9e1pP0CVEUCdj5BmfIZxRBTSDycnbqhIOGec9QYtmVH2fbLpj86CFWkrNOkt/Fvty4KZG5lTglL9j/gJ87w=="
},
"node_modules/fs-minipass": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-2.1.0.tgz",
......
......@@ -16,6 +16,7 @@
"dotenv": "^16.0.3",
"express": "^4.18.2",
"express-async-handler": "^1.2.0",
"fs": "^0.0.1-security",
"joi-password-complexity": "^5.1.0",
"jsonwebtoken": "^9.0.0",
"mongoose": "^7.0.4",
......@@ -691,6 +692,11 @@
"node": ">= 0.6"
}
},
"node_modules/fs": {
"version": "0.0.1-security",
"resolved": "https://registry.npmjs.org/fs/-/fs-0.0.1-security.tgz",
"integrity": "sha512-3XY9e1pP0CVEUCdj5BmfIZxRBTSDycnbqhIOGec9QYtmVH2fbLpj86CFWkrNOkt/Fvty4KZG5lTglL9j/gJ87w=="
},
"node_modules/fs-minipass": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-2.1.0.tgz",
......@@ -2594,6 +2600,11 @@
"resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz",
"integrity": "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q=="
},
"fs": {
"version": "0.0.1-security",
"resolved": "https://registry.npmjs.org/fs/-/fs-0.0.1-security.tgz",
"integrity": "sha512-3XY9e1pP0CVEUCdj5BmfIZxRBTSDycnbqhIOGec9QYtmVH2fbLpj86CFWkrNOkt/Fvty4KZG5lTglL9j/gJ87w=="
},
"fs-minipass": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-2.1.0.tgz",
......
......@@ -17,6 +17,7 @@
"dotenv": "^16.0.3",
"express": "^4.18.2",
"express-async-handler": "^1.2.0",
"fs": "^0.0.1-security",
"joi-password-complexity": "^5.1.0",
"jsonwebtoken": "^9.0.0",
"mongoose": "^7.0.4",
......
backend/public/uploads/1d07174c-0687-41d3-9cdc-98fd2e4ae0a8_.jpg

132 KiB

backend/public/uploads/2740e421-6b6c-4db3-be6a-1379d8dd3240_.jpg

289 KiB

backend/public/uploads/4d0e6f3c-a919-489f-8e64-d60910601ed9_.JPG

391 KiB

backend/public/uploads/4d3e6514-fd66-4a7c-a508-3af24bbcb763_.jpg

102 KiB

backend/public/uploads/7f3d200b-f57a-4c1d-9965-72c024d0338e_.PNG

1.71 MiB

backend/public/uploads/81976f69-cdcb-4376-820b-7db0bf090af8_.jpg

133 KiB

backend/public/uploads/8d419a28-5c3c-44d7-859e-014acc699dd9_.jpg

2.01 MiB

backend/public/uploads/8d95b2c8-587c-4a23-9dbf-2f6d2429b309_.jpg

133 KiB

backend/public/uploads/8f372ec1-4cf9-4a49-8b71-0b325cdb4720_.jpg

102 KiB

backend/public/uploads/9f36fed7-bc98-4dc4-a1ee-8b477451bc52_.jpg

133 KiB

backend/public/uploads/a1ffe18f-fb52-40b4-803c-d6f1555f6f7a_.jpg

1.05 MiB

backend/public/uploads/b7401caa-04a5-43c9-a348-94668f8218b6_.JPG

391 KiB

backend/public/uploads/bb539d72-f358-4056-a414-d57087a84692_.jpg

133 KiB

backend/public/uploads/c504c974-e8dd-4dbd-8441-270a85e608a3_.jpg

133 KiB

backend/public/uploads/c777c56e-9637-437a-a832-ddca6a72d4d1_.jpg

133 KiB

0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment