logs: Added log import form.
the build was successful

This commit is contained in:
2018-12-02 14:18:56 +01:00
parent 8fd9b19bd0
commit c4636cf843
7 changed files with 196 additions and 11 deletions
+47
View File
@@ -124,6 +124,53 @@ class LogAPI {
})
}
/**
* Call `importLog(input)` mutation, returns multpile logs.
*
* @param {{importer:"MircLike"|"ForumLog", date?:Date|string|number, channel:string, timezone:string, data:string}} input
* @returns {Promise<Log[]>}
*/
import(input) {
return query(`
mutation ImportLog($input: LogImportInput!) {
importLog(input: $input) {
id
shortId
date
title
eventName
description
open
channel {
name
logged
hub
eventName
locationName
}
characters {
id
nicks
author
name
shortName
description
}
posts {
id
position
time
kind
nick
text
}
}
}
`, {input}, {permissions: ["log.add"]}).then(({importLog}) => {
return importLog.map(d => Log.fromData(d))
})
}
/**
* Call `editLog(input)` mutation, returns the id and all editable fields.
*