Skip to content

Commit

Permalink
fix(#76-support-search): restore edit
Browse files Browse the repository at this point in the history
  • Loading branch information
y9Kap committed Oct 31, 2023
1 parent fa28cbe commit 2512e66
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -171,22 +171,22 @@ internal class MeetingsEngine(
@Serializable
private data class EditMeetingBody(
val meetingId: MeetingIdSerializable,
val title: String?,
val description: String?,
val location: LocationSerializable?,
val date: DateSerializable?,
val title: OptionalSerializable<String>,
val description: OptionalSerializable<String>,
val location: OptionalSerializable<LocationSerializable>,
val date: OptionalSerializable<DateSerializable>,
val avatarId: OptionalSerializable<FileIdSerializable?> = OptionalSerializable.Undefined,
val visibility: MeetingSerializable.Visibility?
val visibility: OptionalSerializable<MeetingSerializable.Visibility>
)

private fun EditMeetingRequest.toBody() = EditMeetingBody(
meetingId.serializable(),
title,
description,
location?.serializable(),
date?.serializable(),
title.serializable(),
description.serializable(),
location.map { it.serializable() }.serializable(),
date.map { it.serializable() }.serializable(),
avatarId.map { it?.serializable() }.serializable(),
visibility?.serializable()
visibility.map { it.serializable() }.serializable(),
)

suspend fun editMeeting(request: EditMeetingRequest): EditMeetingRequest.Response = with(request) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public data class EditMeetingRequest(
public val token: Token,
public val meetingId: MeetingId,
public val title: Optional<String>,
public val description: Optional<String?>,
public val description: Optional<String>,
public val location: Optional<Location>,
public val date: Optional<Date>,
public val avatarId: Optional<FileId?>,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public class AuthorizedMeetingRepository(
title: String,
date: Date,
location: Location,
description: String?,
description: String,
avatarId: FileId?,
visibility: Meeting.Visibility
): AuthorizedMeetingRepository = edited(
Expand All @@ -52,7 +52,7 @@ public class AuthorizedMeetingRepository(
title: Optional<String> = Optional.Undefined,
date: Optional<Date> = Optional.Undefined,
location: Optional<Location> = Optional.Undefined,
description: Optional<String?> = Optional.Undefined,
description: Optional<String> = Optional.Undefined,
avatarId: Optional<FileId?> = Optional.Undefined,
visibility: Optional<Meeting.Visibility> = Optional.Undefined
): AuthorizedMeetingRepository {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public class AuthorizedMeetingsApi(
title: String,
date: Date,
location: Location,
description: String?,
description: String,
avatarId: FileId?,
visibility: Meeting.Visibility
): AuthorizedMeetingRepository = edit(
Expand All @@ -68,7 +68,7 @@ public class AuthorizedMeetingsApi(
title: Optional<String> = Optional.Undefined,
date: Optional<Date> = Optional.Undefined,
location: Optional<Location> = Optional.Undefined,
description: Optional<String?> = Optional.Undefined,
description: Optional<String> = Optional.Undefined,
avatarId: Optional<FileId?> = Optional.Undefined,
visibility: Optional<Meeting.Visibility> = Optional.Undefined
): AuthorizedMeetingRepository {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public class MeetingRepository(
title: String,
date: Date,
location: Location,
description: String?,
description: String,
avatarId: FileId?,
visibility: Meeting.Visibility
): MeetingRepository = edited(
Expand All @@ -57,7 +57,7 @@ public class MeetingRepository(
title: Optional<String> = Optional.Undefined,
date: Optional<Date> = Optional.Undefined,
location: Optional<Location> = Optional.Undefined,
description: Optional<String?> = Optional.Undefined,
description: Optional<String> = Optional.Undefined,
avatarId: Optional<FileId?> = Optional.Undefined,
visibility: Optional<Meeting.Visibility> = Optional.Undefined
): MeetingRepository {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public class MeetingsApi(private val api: MeetacyApi) {
title: String,
date: Date,
location: Location,
description: String?,
description: String,
avatarId: FileId?,
visibility: Meeting.Visibility
): MeetingRepository = edit(
Expand All @@ -76,7 +76,7 @@ public class MeetingsApi(private val api: MeetacyApi) {
title: Optional<String> = Optional.Undefined,
date: Optional<Date> = Optional.Undefined,
location: Optional<Location> = Optional.Undefined,
description: Optional<String?> = Optional.Undefined,
description: Optional<String> = Optional.Undefined,
avatarId: Optional<FileId?> = Optional.Undefined,
visibility: Optional<Meeting.Visibility> = Optional.Undefined
): MeetingRepository {
Expand Down

0 comments on commit 2512e66

Please sign in to comment.