improve search performance in contribution member search
This commit is contained in:
parent
972b1845ed
commit
fc368bcd1a
|
@ -119,6 +119,10 @@ class MemberResource extends JsonResource
|
||||||
*/
|
*/
|
||||||
public static function meta(): array
|
public static function meta(): array
|
||||||
{
|
{
|
||||||
|
if (request()->header('X-Meta') === 'false') {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
|
||||||
if (request()->header('X-Inertia-Partial-Data', '') !== '' && !str_contains(request()->header('X-Inertia-Partial-Data', ''), 'meta')) {
|
if (request()->header('X-Inertia-Partial-Data', '') !== '' && !str_contains(request()->header('X-Inertia-Partial-Data', ''), 'meta')) {
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
|
@ -66,13 +66,17 @@ export default {
|
||||||
this.search.s = event;
|
this.search.s = event;
|
||||||
|
|
||||||
debounce(async () => {
|
debounce(async () => {
|
||||||
var response = await this.axios.post('/api/member/search', {
|
var response = await this.axios.post(
|
||||||
|
'/api/member/search',
|
||||||
|
{
|
||||||
filter: {
|
filter: {
|
||||||
search: event,
|
search: event,
|
||||||
hasBirthday: true,
|
hasBirthday: true,
|
||||||
hasFullAddress: true,
|
hasFullAddress: true,
|
||||||
},
|
},
|
||||||
});
|
},
|
||||||
|
{ headers: { 'X-Meta': 'false' } }
|
||||||
|
);
|
||||||
|
|
||||||
this.search.results = response.data.data;
|
this.search.results = response.data.data;
|
||||||
}, 300)();
|
}, 300)();
|
||||||
|
|
Loading…
Reference in New Issue