Skip to content

Commit 7878311

Browse files
authored
Merge pull request #156 from typesense/t
Fix example.
2 parents 7bdab31 + 54c431e commit 7878311

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

example/console-simple/bin/synonyms.dart

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -134,16 +134,10 @@ Future<void> createOneWay(Client client) async {
134134
Future<void> retrieveAll(Client client) async {
135135
try {
136136
logInfoln(log, 'Retrieving all synonyms of `set_name` synonym set.');
137-
final response = await client.synonymSet('set_name').upsert(
138-
SynonymSetCreateSchema(
139-
items: [
140-
SynonymItemSchema(
141-
id: 'synonyms-doofenshmirtz',
142-
synonyms: ['Doofenshmirtz', 'Heinz', 'Evil'])
143-
],
144-
),
145-
);
146-
log.fine(response.toJson());
137+
final response = await client.synonymSet('set_name').listItems();
138+
for (final item in response) {
139+
log.fine(item.toJson());
140+
}
147141
} on RequestException catch (e, stackTrace) {
148142
log.severe(e.message, e, stackTrace);
149143
} catch (e, stackTrace) {

0 commit comments

Comments
 (0)