@@ -62,6 +62,12 @@ func (r *mutationResolver) SplitLog(ctx context.Context, input graphcore.LogSpli
|
||||
return r.s.Logs.SplitLog(ctx, input.LogID, input.StartPostID)
|
||||
}
|
||||
|
||||
func (r *mutationResolver) MergeLog(ctx context.Context, input graphcore.LogMergeInput) (*models.Log, error) {
|
||||
removeAfter := input.RemoveAfter != nil && *input.RemoveAfter
|
||||
|
||||
return r.s.Logs.MergeLogs(ctx, input.TargetLogID, input.SourceLogID, removeAfter)
|
||||
}
|
||||
|
||||
func (r *mutationResolver) EditLog(ctx context.Context, input graphcore.LogEditInput) (*models.Log, error) {
|
||||
update := models.LogUpdate{
|
||||
Open: input.Open,
|
||||
|
||||
@@ -120,6 +120,9 @@ type Mutation {
|
||||
# Split a log
|
||||
splitLog(input: LogSplitInput!): Log!
|
||||
|
||||
# Merge a log
|
||||
mergeLog(input: LogMergeInput!): Log!
|
||||
|
||||
# Edit a log
|
||||
editLog(input: LogEditInput!): Log!
|
||||
|
||||
|
||||
@@ -129,10 +129,24 @@ input LogSplitInput {
|
||||
"Log ID"
|
||||
logId: String!
|
||||
|
||||
"After Post ID"
|
||||
"Split out all posts from and including the post with this ID"
|
||||
startPostId: String!
|
||||
}
|
||||
|
||||
"""
|
||||
Input for mergeLog mutation.
|
||||
"""
|
||||
input LogMergeInput {
|
||||
"Target log ID"
|
||||
targetLogId: String!
|
||||
|
||||
"Source log ID"
|
||||
sourceLogId: String!
|
||||
|
||||
"Remove the source log after merging"
|
||||
removeAfter: Boolean
|
||||
}
|
||||
|
||||
enum LogImporter {
|
||||
"""
|
||||
mIRC-like: This importer parses logs that copied from mIRC posts without spaces.
|
||||
|
||||
Reference in New Issue
Block a user