Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: bulk api response type #66

Merged
merged 4 commits into from
Feb 20, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/main/kotlin/api/EventsApi.kt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ interface EventsApi {
suspend fun triggerEvent(@Body body: TriggerEventRequest): Response<ResponseWrapper<TriggerResponse>>

@POST("$ENDPOINT/trigger/bulk")
suspend fun bulkTriggerEvent(@Body body: BulkTriggerEventRequest): Response<ResponseWrapper<TriggerResponse>>
suspend fun bulkTriggerEvent(@Body body: BulkTriggerEventRequest): Response<ResponseWrapper<List<TriggerResponse>>>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good but you need to modify the unit test based on your changes

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


@POST("$ENDPOINT/trigger/broadcast")
suspend fun broadcastEvent(@Body body: BroadcastEventRequest): Response<ResponseWrapper<TriggerResponse>>
Expand Down
2 changes: 1 addition & 1 deletion src/main/kotlin/extensions/EventsExtensions.kt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ suspend fun Novu.trigger(body: TriggerEventRequest): ResponseWrapper<TriggerResp
return response.extractResponse(logger)
}

suspend fun Novu.bulkTrigger(body: BulkTriggerEventRequest): ResponseWrapper<TriggerResponse>? {
suspend fun Novu.bulkTrigger(body: BulkTriggerEventRequest): ResponseWrapper<List<TriggerResponse>>? {
val response = eventsApi.bulkTriggerEvent(body)
return response.extractResponse(logger)
}
Expand Down