mirror of
https://github.com/Foundry376/Mailspring.git
synced 2024-11-12 04:25:31 +08:00
34 lines
617 B
Text
34 lines
617 B
Text
|
import {Event, ModelSearchIndexer} from 'nylas-exports'
|
||
|
|
||
|
|
||
|
const INDEX_VERSION = 1
|
||
|
|
||
|
class EventSearchIndexer extends ModelSearchIndexer {
|
||
|
|
||
|
get ConfigKey() {
|
||
|
return 'eventSearchIndexVersion';
|
||
|
}
|
||
|
|
||
|
get IndexVersion() {
|
||
|
return INDEX_VERSION;
|
||
|
}
|
||
|
|
||
|
get ModelClass() {
|
||
|
return Event;
|
||
|
}
|
||
|
|
||
|
getIndexDataForModel(event) {
|
||
|
const {title, description, location, participants} = event
|
||
|
return {
|
||
|
title,
|
||
|
location,
|
||
|
description,
|
||
|
participants: participants
|
||
|
.map((c) => `${c.name || ''} ${c.email || ''}`)
|
||
|
.join(' '),
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
export default new EventSearchIndexer()
|