-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #31 from recepkefelii/aws-s3
Aws s3
- Loading branch information
Showing
15 changed files
with
64 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,16 @@ | ||
import { Module } from "@nestjs/common"; | ||
import { CreatePostModule } from "./create-post/create.post.module"; | ||
import { UpdatePostController } from "./update-post/update.post.controller"; | ||
import { UpdatePostModule } from "./update-post/update.post.module"; | ||
import { PostService } from './post.service'; | ||
import { PostController } from './post.controller'; | ||
import { MongooseModule } from "@nestjs/mongoose"; | ||
import { Post, PostSchema } from "./schemas/post.schema"; | ||
import { JwtService } from "@nestjs/jwt"; | ||
|
||
@Module({ | ||
imports: [MongooseModule.forFeature([{ name: Post.name, schema: PostSchema }]), | ||
CreatePostModule, UpdatePostModule], | ||
providers: [PostService], | ||
CreatePostModule, UpdatePostModule], | ||
providers: [PostService, JwtService], | ||
controllers: [PostController] | ||
}) | ||
export class PostModule { } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,25 @@ | ||
import { Injectable } from '@nestjs/common'; | ||
import { Injectable, NotFoundException, Post } from '@nestjs/common'; | ||
import { InjectModel } from '@nestjs/mongoose'; | ||
import { Model } from 'mongoose'; | ||
import { User, UserDocument } from 'src/auth/schema/user.schema'; | ||
import { PostDocument } from 'src/post/schemas/post.schema'; | ||
import { UploadBannerService } from './banner-upload/upload.banner.service'; | ||
import { UserdDto } from './dto/user.dto'; | ||
|
||
@Injectable() | ||
export class UsersService { | ||
constructor( | ||
@InjectModel(User.name) private userModel: Model<UserDocument>, | ||
@InjectModel(Post.name) private postModel: Model<PostDocument>, | ||
private readonly uploadBannerServive: UploadBannerService | ||
) { | ||
|
||
} | ||
async userProfile(user: UserdDto) { | ||
return await this.userModel.findById(user.id).select("-password") | ||
const profile = await this.userModel | ||
.findOne({ id: user.id }) | ||
.select("-password") | ||
.populate("posts"); | ||
return profile; | ||
} | ||
} |