|
1 | 1 | package api |
2 | 2 |
|
3 | 3 | import ( |
4 | | - "encoding/json" |
5 | | - "strconv" |
6 | | - "strings" |
7 | | - |
8 | 4 | "github.com/supertokens/supertokens-golang/recipe/dashboard/dashboardmodels" |
9 | 5 | "github.com/supertokens/supertokens-golang/recipe/emailpassword" |
10 | 6 | "github.com/supertokens/supertokens-golang/recipe/passwordless" |
11 | 7 | "github.com/supertokens/supertokens-golang/recipe/thirdparty" |
12 | 8 | "github.com/supertokens/supertokens-golang/recipe/thirdpartyemailpassword" |
13 | 9 | "github.com/supertokens/supertokens-golang/recipe/thirdpartypasswordless" |
14 | | - "github.com/supertokens/supertokens-golang/supertokens" |
15 | 10 | ) |
16 | 11 |
|
17 | 12 | func IsValidRecipeId(recipeId string) bool { |
@@ -188,48 +183,3 @@ func IsRecipeInitialised(recipeId string) bool { |
188 | 183 |
|
189 | 184 | return isRecipeInitialised |
190 | 185 | } |
191 | | - |
192 | | -// TODO: Add tests |
193 | | -func getUsersWithSearch(timeJoinedOrder string, paginationToken *string, limit *int, includeRecipeIds *[]string, searchParams map[string]string) (supertokens.UserPaginationResult, error) { |
194 | | - |
195 | | - querier, err := supertokens.GetNewQuerierInstanceOrThrowError("") |
196 | | - if err != nil { |
197 | | - return supertokens.UserPaginationResult{}, err |
198 | | - } |
199 | | - |
200 | | - requestBody := map[string]string{} |
201 | | - if searchParams != nil { |
202 | | - requestBody = searchParams |
203 | | - } |
204 | | - requestBody["timeJoinedOrder"] = timeJoinedOrder |
205 | | - if limit != nil { |
206 | | - requestBody["limit"] = strconv.Itoa(*limit) |
207 | | - } |
208 | | - if paginationToken != nil { |
209 | | - requestBody["paginationToken"] = *paginationToken |
210 | | - } |
211 | | - if includeRecipeIds != nil { |
212 | | - requestBody["includeRecipeIds"] = strings.Join((*includeRecipeIds)[:], ",") |
213 | | - } |
214 | | - |
215 | | - resp, err := querier.SendGetRequest("/users", requestBody) |
216 | | - |
217 | | - if err != nil { |
218 | | - return supertokens.UserPaginationResult{}, err |
219 | | - } |
220 | | - |
221 | | - temporaryVariable, err := json.Marshal(resp) |
222 | | - if err != nil { |
223 | | - return supertokens.UserPaginationResult{}, err |
224 | | - } |
225 | | - |
226 | | - var result = supertokens.UserPaginationResult{} |
227 | | - |
228 | | - err = json.Unmarshal(temporaryVariable, &result) |
229 | | - |
230 | | - if err != nil { |
231 | | - return supertokens.UserPaginationResult{}, err |
232 | | - } |
233 | | - |
234 | | - return result, nil |
235 | | -} |
0 commit comments