summaryrefslogtreecommitdiffhomepage
path: root/backend/src/main/java/com/blog/web/dto
diff options
context:
space:
mode:
authorrealtradam <[email protected]>2024-07-27 23:24:57 -0400
committerrealtradam <[email protected]>2024-07-27 23:24:57 -0400
commit55ec4c9dbd9fa1b98cab03f046c98d33125fb484 (patch)
treecc6efb54999dfbfd0208bfee0a9da76c822791ca /backend/src/main/java/com/blog/web/dto
parentc366e70e95156d2637f82116312770e12a9aad32 (diff)
downloadspring-blog-55ec4c9dbd9fa1b98cab03f046c98d33125fb484.tar.gz
spring-blog-55ec4c9dbd9fa1b98cab03f046c98d33125fb484.zip
make edit buttons conditional on user
Diffstat (limited to 'backend/src/main/java/com/blog/web/dto')
-rw-r--r--backend/src/main/java/com/blog/web/dto/ArticleDto.java6
-rw-r--r--backend/src/main/java/com/blog/web/dto/ArticlePublicDto.java2
2 files changed, 6 insertions, 2 deletions
diff --git a/backend/src/main/java/com/blog/web/dto/ArticleDto.java b/backend/src/main/java/com/blog/web/dto/ArticleDto.java
index 755b1f6..9e82c40 100644
--- a/backend/src/main/java/com/blog/web/dto/ArticleDto.java
+++ b/backend/src/main/java/com/blog/web/dto/ArticleDto.java
@@ -29,7 +29,7 @@ public class ArticleDto {
@JoinColumn(name = "created_by", nullable = false)
private UserEntity createdBy;
- public ArticleDto(long id, String title, String photoUrl, String content, UserEntity createdBy, LocalDateTime createdOn, LocalDateTime updatedOn) {
+ public ArticleDto(Long id, String title, String photoUrl, String content, UserEntity createdBy, LocalDateTime createdOn, LocalDateTime updatedOn) {
this.id = id;
this.title = title;
this.photoUrl = photoUrl;
@@ -111,4 +111,8 @@ public class ArticleDto {
public String getUsername() {
return createdBy.getUsername();
}
+
+ public Long getUserId() {
+ return createdBy.getId();
+ }
}
diff --git a/backend/src/main/java/com/blog/web/dto/ArticlePublicDto.java b/backend/src/main/java/com/blog/web/dto/ArticlePublicDto.java
index 5dac4fe..50dda43 100644
--- a/backend/src/main/java/com/blog/web/dto/ArticlePublicDto.java
+++ b/backend/src/main/java/com/blog/web/dto/ArticlePublicDto.java
@@ -13,7 +13,7 @@ public class ArticlePublicDto {
private LocalDateTime updatedOn;
private String createdBy;
- public ArticlePublicDto(long id, String title, String photoUrl, String content, String createdBy, LocalDateTime createdOn, LocalDateTime updatedOn) {
+ public ArticlePublicDto(Long id, String title, String photoUrl, String content, String createdBy, LocalDateTime createdOn, LocalDateTime updatedOn) {
this.id = id;
this.title = title;
this.photoUrl = photoUrl;