Skip to content
This repository has been archived by the owner on Aug 18, 2024. It is now read-only.

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
hayato24s committed Mar 9, 2024
1 parent 25fbe4a commit 1832f65
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion handler/api/rpc/shared/conv/type.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func ToPBRFC3339DateTime(t time.Time) *sharedpb.RFC3339DateTime {

func FromPBRFC3339FullDate(pbFullDate *sharedpb.RFC3339FullDate) (civil.Date, error) {
if pbFullDate == nil {
return civil.Date{}, errors.New("full date time must be present")
return civil.Date{}, errors.New("full date must be present")
}
return civil.ParseDate(pbFullDate.Value)
}
Expand Down
5 changes: 5 additions & 0 deletions module/timetable/repository/registered_course.go
Original file line number Diff line number Diff line change
Expand Up @@ -299,8 +299,13 @@ type dbRegisteredCourseSchedule struct {
}

func fromDBRegisteredCourseMethods(dbMethods string) ([]timetabledomain.CourseMethod, error) {
if dbMethods == "{}" {
return nil, nil
}

dbMethods = strings.TrimPrefix(dbMethods, "{")
dbMethods = strings.TrimSuffix(dbMethods, "}")

return base.MapWithErr(strings.Split(dbMethods, ","), timetabledomain.ParseCourseMethod)
}

Expand Down

0 comments on commit 1832f65

Please sign in to comment.