GitHub / Twitter連携の設定をDBに保存するように
This commit is contained in:
parent
5675ecead9
commit
cb6f390fb6
12 changed files with 632 additions and 476 deletions
|
@ -99,6 +99,32 @@ if ((config as any).maintainer) {
|
|||
}
|
||||
});
|
||||
}
|
||||
if ((config as any).twitter) {
|
||||
Meta.findOne({}).then(m => {
|
||||
if (m != null && m.enableTwitterIntegration == null) {
|
||||
Meta.update({}, {
|
||||
$set: {
|
||||
enableTwitterIntegration: true,
|
||||
twitterConsumerKey: (config as any).twitter.consumer_key,
|
||||
twitterConsumerSecret: (config as any).twitter.consumer_secret
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
if ((config as any).github) {
|
||||
Meta.findOne({}).then(m => {
|
||||
if (m != null && m.enableGithubIntegration == null) {
|
||||
Meta.update({}, {
|
||||
$set: {
|
||||
enableGithubIntegration: true,
|
||||
githubClientId: (config as any).github.client_id,
|
||||
githubClientSecret: (config as any).github.client_secret
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
export type IMeta = {
|
||||
name?: string;
|
||||
|
@ -157,4 +183,12 @@ export type IMeta = {
|
|||
* Max allowed note text length in charactors
|
||||
*/
|
||||
maxNoteTextLength?: number;
|
||||
|
||||
enableTwitterIntegration?: boolean;
|
||||
twitterConsumerKey?: string;
|
||||
twitterConsumerSecret?: string;
|
||||
|
||||
enableGithubIntegration?: boolean;
|
||||
githubClientId?: string;
|
||||
githubClientSecret?: string;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue