Skip to content

Commit a6660e7

Browse files
committed
Remove old CheckDelete concept
1 parent 0051e67 commit a6660e7

14 files changed

Lines changed: 0 additions & 60 deletions

File tree

backend/command/account.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ import (
1010
)
1111

1212
var ErrAccountNotFound = errors.New("account not found")
13-
14-
// TODO: Move this to the Account domain model.
1513
var ErrDeleteAdminAccount = errors.New("cannot delete admin account")
1614

1715
func (cmd *Command) FollowBlog(accountID uuid.UUID, blogID uuid.UUID) error {

backend/ddd/account.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,6 @@ func (a *Account) UpdatedAt() time.Time {
8181
return a.updatedAt
8282
}
8383

84-
func (a *Account) CheckDelete() error {
85-
return nil
86-
}
87-
8884
func (a *Account) FollowBlog(blogID uuid.UUID) error {
8985
if slices.Contains(a.followedBlogIDs, blogID) {
9086
return fmt.Errorf("account: already following blog")

backend/ddd/blog.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,3 @@ func (b *Blog) SetUpdatedAt(updatedAt time.Time) error {
115115
b.updatedAt = updatedAt
116116
return nil
117117
}
118-
119-
func (b *Blog) CheckDelete() error {
120-
return nil
121-
}

backend/ddd/post.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,3 @@ func (p *Post) SetUpdatedAt(updatedAt time.Time) error {
102102
p.updatedAt = updatedAt
103103
return nil
104104
}
105-
106-
func (p *Post) CheckDelete() error {
107-
return nil
108-
}

backend/model/account.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,3 @@ func (a *Account) CreatedAt() time.Time {
9494
func (a *Account) UpdatedAt() time.Time {
9595
return a.updatedAt
9696
}
97-
98-
func (a *Account) CheckDelete() error {
99-
// TODO: Ensure admin accounts cannot be deleted.
100-
return nil
101-
}

backend/model/blog.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,3 @@ func (b *Blog) SetUpdatedAt(updatedAt time.Time) error {
117117
b.updatedAt = updatedAt
118118
return nil
119119
}
120-
121-
func (b *Blog) CheckDelete() error {
122-
return nil
123-
}

backend/model/post.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,3 @@ func (p *Post) SetUpdatedAt(updatedAt time.Time) error {
102102
p.updatedAt = updatedAt
103103
return nil
104104
}
105-
106-
func (p *Post) CheckDelete() error {
107-
return nil
108-
}

backend/model/session.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,3 @@ func (s *Session) CreatedAt() time.Time {
8989
func (s *Session) UpdatedAt() time.Time {
9090
return s.updatedAt
9191
}
92-
93-
func (s *Session) CheckDelete() error {
94-
return nil
95-
}

backend/model/tag.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,3 @@ func (t *Tag) SetUpdatedAt(updatedAt time.Time) error {
5959
t.updatedAt = updatedAt
6060
return nil
6161
}
62-
63-
func (t *Tag) CheckDelete() error {
64-
return nil
65-
}

backend/repository/account.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -294,11 +294,6 @@ func (r *AccountRepository) Delete(account *model.Account) error {
294294
WHERE id = $1
295295
RETURNING id`
296296

297-
err := account.CheckDelete()
298-
if err != nil {
299-
return err
300-
}
301-
302297
ctx, cancel := context.WithTimeout(context.Background(), postgres.Timeout)
303298
defer cancel()
304299

0 commit comments

Comments
 (0)