Skip to content

Commit 25c6114

Browse files
committed
Fix typo in voice callflow handling
1 parent cbc106f commit 25c6114

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

voice/callflow.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -105,13 +105,13 @@ func (callflow *CallFlow) UnmarshalJSON(data []byte) error {
105105
// An error is returned if no such call flow exists or is accessible.
106106
func CallFlowByID(client *messagebird.Client, id string) (*CallFlow, error) {
107107
callflow := &CallFlow{}
108-
err := client.Request(callflow, "GET", "call-flow/"+id, nil)
108+
err := client.Request(callflow, "GET", "call-flows/"+id, nil)
109109
return callflow, err
110110
}
111111

112112
// CallFlows returns a Paginator which iterates over all CallFlows.
113113
func CallFlows(client *messagebird.Client) *Paginator {
114-
return newPaginator(client, "call-flow/", reflect.TypeOf(CallFlow{}))
114+
return newPaginator(client, "call-flows/", reflect.TypeOf(CallFlow{}))
115115
}
116116

117117
// Create creates the callflow remotely.
@@ -121,7 +121,7 @@ func (callflow *CallFlow) Create(client *messagebird.Client) error {
121121
var data struct {
122122
Data []CallFlow `json:"data"`
123123
}
124-
if err := client.Request(&data, "POST", "call-flow/", callflow); err != nil {
124+
if err := client.Request(&data, "POST", "call-flows/", callflow); err != nil {
125125
return err
126126
}
127127
*callflow = data.Data[0]
@@ -135,7 +135,7 @@ func (callflow *CallFlow) Update(client *messagebird.Client) error {
135135
var data struct {
136136
Data []CallFlow `json:"data"`
137137
}
138-
if err := client.Request(callflow, "PUT", "call-flow/"+callflow.ID, callflow); err != nil {
138+
if err := client.Request(&data, "PUT", "call-flows/"+callflow.ID, callflow); err != nil {
139139
return err
140140
}
141141
*callflow = data.Data[0]
@@ -144,7 +144,7 @@ func (callflow *CallFlow) Update(client *messagebird.Client) error {
144144

145145
// Delete deletes the CallFlow.
146146
func (callflow *CallFlow) Delete(client *messagebird.Client) error {
147-
return client.Request(nil, "DELETE", "call-flow/"+callflow.ID, nil)
147+
return client.Request(nil, "DELETE", "call-flows/"+callflow.ID, nil)
148148
}
149149

150150
// A CallFlowStep is a single step that can be taken in a callflow.

0 commit comments

Comments
 (0)