+1
-1
frontend/src/client.ts
+1
-1
frontend/src/client.ts
+8
-22
frontend/src/features/slices/waitlist/api.ts
+8
-22
frontend/src/features/slices/waitlist/api.ts
···
61
61
62
62
async function searchActorsAndProfiles(
63
63
client: AtProtoClient,
64
-
sliceUri: string,
65
64
search: string
66
65
): Promise<string[]> {
67
66
if (!search?.trim()) {
···
73
72
74
73
try {
75
74
// Search actors by handle or DID
76
-
const actorsResponse = await client.network.slices.slice.getActors({
77
-
slice: sliceUri,
78
-
where: {
79
-
$or: {
80
-
handle: { contains: searchTerm },
81
-
did: { eq: searchTerm },
82
-
},
75
+
const actorsResponse = await client.getActors({
76
+
orWhere: {
77
+
handle: { contains: searchTerm },
78
+
did: { eq: searchTerm },
83
79
},
84
80
});
85
81
···
123
119
124
120
// Add search condition if provided
125
121
if (search && search.trim()) {
126
-
const matchingDids = await searchActorsAndProfiles(
127
-
client,
128
-
sliceUri,
129
-
search
130
-
);
122
+
const matchingDids = await searchActorsAndProfiles(client, search);
131
123
if (matchingDids.length > 0) {
132
124
whereConditions.did = { in: matchingDids };
133
125
} else {
···
156
148
157
149
try {
158
150
// Fetch actors to get handles
159
-
const actorsResponse = await client.network.slices.slice.getActors({
160
-
slice: sliceUri,
151
+
const actorsResponse = await client.getActors({
161
152
where: {
162
153
did: { in: dids },
163
154
},
···
218
209
219
210
// Add search condition if provided
220
211
if (search && search.trim()) {
221
-
const matchingDids = await searchActorsAndProfiles(
222
-
client,
223
-
sliceUri,
224
-
search
225
-
);
212
+
const matchingDids = await searchActorsAndProfiles(client, search);
226
213
if (matchingDids.length > 0) {
227
214
whereConditions.did = { in: matchingDids };
228
215
} else {
···
251
238
252
239
try {
253
240
// Fetch actors to get handles
254
-
const actorsResponse = await client.network.slices.slice.getActors({
255
-
slice: sliceUri,
241
+
const actorsResponse = await client.getActors({
256
242
where: {
257
243
did: { in: dids },
258
244
},
+1
-1
packages/cli/src/generated_client.ts
+1
-1
packages/cli/src/generated_client.ts
+11
-1
packages/client/src/mod.ts
+11
-1
packages/client/src/mod.ts
···
75
75
limit?: number;
76
76
cursor?: string;
77
77
where?: ActorWhereConditions;
78
+
orWhere?: ActorWhereConditions;
78
79
}
79
80
80
81
export interface GetActorsResponse {
···
288
289
}
289
290
290
291
async getActors(params?: GetActorsParams): Promise<GetActorsResponse> {
291
-
const requestParams = { ...params, slice: this.sliceUri };
292
+
const whereClause: Record<string, unknown> = params?.where ? { ...params.where } : {};
293
+
if (params?.orWhere) {
294
+
whereClause.$or = params.orWhere;
295
+
}
296
+
const requestParams = {
297
+
...params,
298
+
where: Object.keys(whereClause).length > 0 ? whereClause : undefined,
299
+
orWhere: undefined,
300
+
slice: this.sliceUri,
301
+
};
292
302
return await this.makeRequest<GetActorsResponse>(
293
303
"network.slices.slice.getActors",
294
304
"POST",