Skip to content

Commit

Permalink
Merge pull request #42 from hadesdday/hoang
Browse files Browse the repository at this point in the history
#8 save post function
  • Loading branch information
hadesdday authored Aug 21, 2022
2 parents aa352ad + b9ce8f6 commit efec4fc
Show file tree
Hide file tree
Showing 39 changed files with 513 additions and 164 deletions.
6 changes: 4 additions & 2 deletions db.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
"name": "Trần Huy Hoàng",
"address": "dia chi",
"dateBirth": "2001-08-27",
"gender": "male"
"gender": "male",
"comfirmToken": "ok"
},
{
"email": "[email protected]",
Expand Down Expand Up @@ -123,5 +124,6 @@
"content": "Rất xinh đẹp tuyệt vời ạ 🥰",
"id": 14
}
]
],
"saved-post": []
}
47 changes: 24 additions & 23 deletions src/app/_api/apiURL.ts
Original file line number Diff line number Diff line change
@@ -1,31 +1,32 @@
export const API_SUB = [
"Chính trị",
"Thời sự",
"Kinh doanh",
"Thế giới",
"Giải trí",
"Thể thao",
"Sức khỏe",
"Đời sống",
"Giáo dục",
"Pháp luật",
"Xe",
"Công nghệ",
"Bất động sản",
"Du lịch",
// "Tuần Việt Nam",
// "Bạn đọc"
"Chính trị",
"Thời sự",
"Kinh doanh",
"Thế giới",
"Giải trí",
"Thể thao",
"Sức khỏe",
"Đời sống",
"Giáo dục",
"Pháp luật",
"Xe",
"Công nghệ",
"Bất động sản",
"Du lịch",
// "Tuần Việt Nam",
// "Bạn đọc"
];

export const API_AUTH = {
LOGIN: "http://localhost:3000/login/",
USER: "http://localhost:3000/user/",
RECOVER: "http://localhost:4200/change-password"
LOGIN: "http://localhost:3000/login/",
USER: "http://localhost:3000/user/",
RECOVER: "http://localhost:4200/change-password"
}

export const API_URL = {
COMMENT: "http://localhost:3000/comments",
GET_LIST: "https://api-news-vietnamnet.herokuapp.com/api/get/",
SEARCH: "https://api-news-vietnamnet.herokuapp.com/api/search/",
ARTICLE_DETAILS: "https://api-news-vietnamnet.herokuapp.com/article/",
COMMENT: "http://localhost:3000/comments",
GET_LIST: "https://api-news-vietnamnet.herokuapp.com/api/get/",
SEARCH: "https://api-news-vietnamnet.herokuapp.com/api/search/",
ARTICLE_DETAILS: "https://api-news-vietnamnet.herokuapp.com/article/",
ARTICLE_SAVED: "http://localhost:3000/saved-post"
}
12 changes: 9 additions & 3 deletions src/app/_service/common.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,16 @@ export class CommonService {
this.toastr.error(errorRes);
return throwError(error);
}
public toastError(successText: string){
this.toastr.error(successText,"Lỗi!!")

public toastError(errorText: string) {
this.toastr.error(errorText, "Lỗi!!")
}

public toastSuccess(successText: string) {
this.toastr.success(successText,"Thành công")
this.toastr.success(successText, "Thành công")
}

public toastAlert(alertText: string) {
this.toastr.warning(alertText,"Lưu ý")
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<div class="container d-flex justify-content-center mt-5">
<div class="non-active-component">
<img src="assets/images/red-cross.png">
<p>Tại khoản của bạn chưa được kích hoạt!</p>
<p>Tài khoản của bạn chưa được kích hoạt!</p>
<p>Xin vui lòng kích hoạt tài khoản để có thể sử dụng!!</p>
<a href="" (click)="resendKey()">Gửi lại email kích hoạt!</a>
<a href="/signin">Quay lại đăng nhập!</a>
Expand Down
42 changes: 0 additions & 42 deletions src/app/pages/home/home.component.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/app/pages/home/home.component.css.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions src/app/pages/home/sub-hot/sub-hot.component.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions src/app/pages/home/sub-hot/sub-hot.component.css.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 16 additions & 0 deletions src/app/pages/home/sub-new/sub-new.component.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions src/app/pages/home/sub-new/sub-new.component.css.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

33 changes: 33 additions & 0 deletions src/app/pages/home/sub-posts/sub-posts.component.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions src/app/pages/home/sub-posts/sub-posts.component.css.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 22 additions & 0 deletions src/app/pages/notfound/notfound.component.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/app/pages/notfound/notfound.component.css.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions src/app/post/post-comment/post-comment.component.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions src/app/post/post-comment/post-comment.component.css.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

40 changes: 40 additions & 0 deletions src/app/post/post-details/post-details.component.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions src/app/post/post-details/post-details.component.css.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/app/post/post-details/post-details.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ <h6>{{item?.title}}</h6>
</div>
</div>
<div class="col-md-4">
<button>Lưu bài viết</button>
<button *ngIf="isSignin==true" (click)="save_post()">Lưu bài viết</button>
<div class="p-4 ads__banner">
<div class="mt-5">
<app-advertisement [url]="'../../../assets/images/ads7.jpeg'"
Expand All @@ -111,4 +111,4 @@ <h6>{{item?.title}}</h6>
</div>
</div>
</div>
<app-footer></app-footer>
<app-footer></app-footer>
Loading

0 comments on commit efec4fc

Please sign in to comment.