Skip to content

Commit

Permalink
WIP(#76-support-auth-header): fix sdk for passed test
Browse files Browse the repository at this point in the history
  • Loading branch information
y9Kap committed Oct 8, 2023
1 parent 2bdf3a1 commit ccd66af
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ internal class FriendsEngine(
private fun EmitFriendsLocationRequest.encodeToPayload(json: Json): Payload = buildPayload {
val initObject = buildJsonObject {
put("apiVersion", apiVersion.int)
put("token", this@encodeToPayload.token.string)
}

data(json.encodeToString(initObject))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,24 +113,24 @@ internal class MeetingsEngine(

suspend fun createMeeting(
request: CreateMeetingRequest
): CreateMeetingRequest.Response {
): CreateMeetingRequest.Response = with(request){
val response = base.meetingsCreatePost(
createMeetingRequest = GeneratedCreateMeetingRequest(
title = request.title,
date = request.date.iso8601,
title = title,
date = date.iso8601,
location = Location(
latitude = request.location.latitude,
longitude = request.location.longitude
latitude = location.latitude,
longitude = location.longitude
),
description = request.description,
visibility = when (request.visibility) {
description = description,
visibility = when (visibility) {
Meeting.Visibility.Public -> GeneratedCreateMeetingRequest.Visibility.PUBLIC
Meeting.Visibility.Private -> GeneratedCreateMeetingRequest.Visibility.PRIVATE
},
avatarId = request.fileId?.string
avatarId = fileId?.string
),
apiVersion = request.apiVersion.int.toString(),
authorization = request.token.string
apiVersion = apiVersion.int.toString(),
authorization = token.string
).result

val meeting = response.mapToMeeting()
Expand Down

0 comments on commit ccd66af

Please sign in to comment.