mirror of
https://github.com/simon-ding/polaris.git
synced 2026-05-27 21:17:50 +08:00
chore: mark as removed instead of delete history
This commit is contained in:
@@ -83,6 +83,7 @@ const (
|
||||
StatusFail Status = "fail"
|
||||
StatusUploading Status = "uploading"
|
||||
StatusSeeding Status = "seeding"
|
||||
StatusRemoved Status = "removed"
|
||||
)
|
||||
|
||||
func (s Status) String() string {
|
||||
@@ -92,7 +93,7 @@ func (s Status) String() string {
|
||||
// StatusValidator is a validator for the "status" field enum values. It is called by the builders before save.
|
||||
func StatusValidator(s Status) error {
|
||||
switch s {
|
||||
case StatusRunning, StatusSuccess, StatusFail, StatusUploading, StatusSeeding:
|
||||
case StatusRunning, StatusSuccess, StatusFail, StatusUploading, StatusSeeding, StatusRemoved:
|
||||
return nil
|
||||
default:
|
||||
return fmt.Errorf("history: invalid enum value for status field: %q", s)
|
||||
|
||||
Reference in New Issue
Block a user