Translate keywords (#114)
This commit is contained in:
@@ -1,11 +1,14 @@
|
||||
import { SQLDataSource } from 'datasource-sql';
|
||||
import { Keyword, KeywordType } from '../types/keyword-types';
|
||||
import { TextsAPI } from './texts-api';
|
||||
|
||||
const MINUTE = 60;
|
||||
|
||||
export class KeywordAPI extends SQLDataSource {
|
||||
constructor(config) {
|
||||
textsApi: TextsAPI;
|
||||
constructor(config, textsApi) {
|
||||
super(config);
|
||||
this.textsApi = textsApi;
|
||||
}
|
||||
|
||||
getType(data: any) {
|
||||
@@ -98,18 +101,8 @@ ORDER BY keywords.value
|
||||
});
|
||||
}
|
||||
}
|
||||
await this.textsApi.translateKeyword(keywordId, name);
|
||||
|
||||
return keywordId;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
category keywords:
|
||||
SELECT category_keyword.category_id, keywords.value
|
||||
FROM category_keyword
|
||||
JOIN keywords ON category_keyword.keyword_id = keywords.id;
|
||||
|
||||
texts:
|
||||
FROM categorydata cd
|
||||
JOIN categorydatakeys cdk ON cd.datakey_id = cdk.id
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user