mirror of
https://github.com/stashapp/stash.git
synced 2025-12-17 04:14:39 +03:00
Add delete for performers and studios
This commit is contained in:
@@ -82,4 +82,8 @@ mutation PerformerUpdate(
|
|||||||
}) {
|
}) {
|
||||||
...PerformerData
|
...PerformerData
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
mutation PerformerDestroy($id: ID!) {
|
||||||
|
performerDestroy(input: { id: $id })
|
||||||
}
|
}
|
||||||
@@ -17,4 +17,8 @@ mutation StudioUpdate(
|
|||||||
studioUpdate(input: { id: $id, name: $name, url: $url, image: $image }) {
|
studioUpdate(input: { id: $id, name: $name, url: $url, image: $image }) {
|
||||||
...StudioData
|
...StudioData
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
mutation StudioDestroy($id: ID!) {
|
||||||
|
studioDestroy(input: { id: $id })
|
||||||
}
|
}
|
||||||
@@ -79,9 +79,11 @@ type Mutation {
|
|||||||
|
|
||||||
performerCreate(input: PerformerCreateInput!): Performer
|
performerCreate(input: PerformerCreateInput!): Performer
|
||||||
performerUpdate(input: PerformerUpdateInput!): Performer
|
performerUpdate(input: PerformerUpdateInput!): Performer
|
||||||
|
performerDestroy(input: PerformerDestroyInput!): Boolean!
|
||||||
|
|
||||||
studioCreate(input: StudioCreateInput!): Studio
|
studioCreate(input: StudioCreateInput!): Studio
|
||||||
studioUpdate(input: StudioUpdateInput!): Studio
|
studioUpdate(input: StudioUpdateInput!): Studio
|
||||||
|
studioDestroy(input: StudioDestroyInput!): Boolean!
|
||||||
|
|
||||||
tagCreate(input: TagCreateInput!): Tag
|
tagCreate(input: TagCreateInput!): Tag
|
||||||
tagUpdate(input: TagUpdateInput!): Tag
|
tagUpdate(input: TagUpdateInput!): Tag
|
||||||
|
|||||||
@@ -66,6 +66,10 @@ input PerformerUpdateInput {
|
|||||||
image: String
|
image: String
|
||||||
}
|
}
|
||||||
|
|
||||||
|
input PerformerDestroyInput {
|
||||||
|
id: ID!
|
||||||
|
}
|
||||||
|
|
||||||
type FindPerformersResultType {
|
type FindPerformersResultType {
|
||||||
count: Int!
|
count: Int!
|
||||||
performers: [Performer!]!
|
performers: [Performer!]!
|
||||||
|
|||||||
@@ -23,6 +23,10 @@ input StudioUpdateInput {
|
|||||||
image: String
|
image: String
|
||||||
}
|
}
|
||||||
|
|
||||||
|
input StudioDestroyInput {
|
||||||
|
id: ID!
|
||||||
|
}
|
||||||
|
|
||||||
type FindStudiosResultType {
|
type FindStudiosResultType {
|
||||||
count: Int!
|
count: Int!
|
||||||
studios: [Studio!]!
|
studios: [Studio!]!
|
||||||
|
|||||||
@@ -175,3 +175,17 @@ func (r *mutationResolver) PerformerUpdate(ctx context.Context, input models.Per
|
|||||||
|
|
||||||
return performer, nil
|
return performer, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (r *mutationResolver) PerformerDestroy(ctx context.Context, input models.PerformerDestroyInput) (bool, error) {
|
||||||
|
qb := models.NewPerformerQueryBuilder()
|
||||||
|
tx := database.DB.MustBeginTx(ctx, nil)
|
||||||
|
if err := qb.Destroy(input.ID, tx); err != nil {
|
||||||
|
_ = tx.Rollback()
|
||||||
|
return false, err
|
||||||
|
}
|
||||||
|
if err := tx.Commit(); err != nil {
|
||||||
|
return false, err
|
||||||
|
}
|
||||||
|
return true, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,11 +3,12 @@ package api
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"database/sql"
|
"database/sql"
|
||||||
|
"strconv"
|
||||||
|
"time"
|
||||||
|
|
||||||
"github.com/stashapp/stash/pkg/database"
|
"github.com/stashapp/stash/pkg/database"
|
||||||
"github.com/stashapp/stash/pkg/models"
|
"github.com/stashapp/stash/pkg/models"
|
||||||
"github.com/stashapp/stash/pkg/utils"
|
"github.com/stashapp/stash/pkg/utils"
|
||||||
"strconv"
|
|
||||||
"time"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func (r *mutationResolver) StudioCreate(ctx context.Context, input models.StudioCreateInput) (*models.Studio, error) {
|
func (r *mutationResolver) StudioCreate(ctx context.Context, input models.StudioCreateInput) (*models.Studio, error) {
|
||||||
@@ -85,3 +86,16 @@ func (r *mutationResolver) StudioUpdate(ctx context.Context, input models.Studio
|
|||||||
|
|
||||||
return studio, nil
|
return studio, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (r *mutationResolver) StudioDestroy(ctx context.Context, input models.StudioDestroyInput) (bool, error) {
|
||||||
|
qb := models.NewStudioQueryBuilder()
|
||||||
|
tx := database.DB.MustBeginTx(ctx, nil)
|
||||||
|
if err := qb.Destroy(input.ID, tx); err != nil {
|
||||||
|
_ = tx.Rollback()
|
||||||
|
return false, err
|
||||||
|
}
|
||||||
|
if err := tx.Commit(); err != nil {
|
||||||
|
return false, err
|
||||||
|
}
|
||||||
|
return true, nil
|
||||||
|
}
|
||||||
|
|||||||
@@ -108,12 +108,14 @@ type ComplexityRoot struct {
|
|||||||
Mutation struct {
|
Mutation struct {
|
||||||
ConfigureGeneral func(childComplexity int, input ConfigGeneralInput) int
|
ConfigureGeneral func(childComplexity int, input ConfigGeneralInput) int
|
||||||
PerformerCreate func(childComplexity int, input PerformerCreateInput) int
|
PerformerCreate func(childComplexity int, input PerformerCreateInput) int
|
||||||
|
PerformerDestroy func(childComplexity int, input PerformerDestroyInput) int
|
||||||
PerformerUpdate func(childComplexity int, input PerformerUpdateInput) int
|
PerformerUpdate func(childComplexity int, input PerformerUpdateInput) int
|
||||||
SceneMarkerCreate func(childComplexity int, input SceneMarkerCreateInput) int
|
SceneMarkerCreate func(childComplexity int, input SceneMarkerCreateInput) int
|
||||||
SceneMarkerDestroy func(childComplexity int, id string) int
|
SceneMarkerDestroy func(childComplexity int, id string) int
|
||||||
SceneMarkerUpdate func(childComplexity int, input SceneMarkerUpdateInput) int
|
SceneMarkerUpdate func(childComplexity int, input SceneMarkerUpdateInput) int
|
||||||
SceneUpdate func(childComplexity int, input SceneUpdateInput) int
|
SceneUpdate func(childComplexity int, input SceneUpdateInput) int
|
||||||
StudioCreate func(childComplexity int, input StudioCreateInput) int
|
StudioCreate func(childComplexity int, input StudioCreateInput) int
|
||||||
|
StudioDestroy func(childComplexity int, input StudioDestroyInput) int
|
||||||
StudioUpdate func(childComplexity int, input StudioUpdateInput) int
|
StudioUpdate func(childComplexity int, input StudioUpdateInput) int
|
||||||
TagCreate func(childComplexity int, input TagCreateInput) int
|
TagCreate func(childComplexity int, input TagCreateInput) int
|
||||||
TagDestroy func(childComplexity int, input TagDestroyInput) int
|
TagDestroy func(childComplexity int, input TagDestroyInput) int
|
||||||
@@ -288,8 +290,10 @@ type MutationResolver interface {
|
|||||||
SceneMarkerDestroy(ctx context.Context, id string) (bool, error)
|
SceneMarkerDestroy(ctx context.Context, id string) (bool, error)
|
||||||
PerformerCreate(ctx context.Context, input PerformerCreateInput) (*Performer, error)
|
PerformerCreate(ctx context.Context, input PerformerCreateInput) (*Performer, error)
|
||||||
PerformerUpdate(ctx context.Context, input PerformerUpdateInput) (*Performer, error)
|
PerformerUpdate(ctx context.Context, input PerformerUpdateInput) (*Performer, error)
|
||||||
|
PerformerDestroy(ctx context.Context, input PerformerDestroyInput) (bool, error)
|
||||||
StudioCreate(ctx context.Context, input StudioCreateInput) (*Studio, error)
|
StudioCreate(ctx context.Context, input StudioCreateInput) (*Studio, error)
|
||||||
StudioUpdate(ctx context.Context, input StudioUpdateInput) (*Studio, error)
|
StudioUpdate(ctx context.Context, input StudioUpdateInput) (*Studio, error)
|
||||||
|
StudioDestroy(ctx context.Context, input StudioDestroyInput) (bool, error)
|
||||||
TagCreate(ctx context.Context, input TagCreateInput) (*Tag, error)
|
TagCreate(ctx context.Context, input TagCreateInput) (*Tag, error)
|
||||||
TagUpdate(ctx context.Context, input TagUpdateInput) (*Tag, error)
|
TagUpdate(ctx context.Context, input TagUpdateInput) (*Tag, error)
|
||||||
TagDestroy(ctx context.Context, input TagDestroyInput) (bool, error)
|
TagDestroy(ctx context.Context, input TagDestroyInput) (bool, error)
|
||||||
@@ -598,6 +602,18 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in
|
|||||||
|
|
||||||
return e.complexity.Mutation.PerformerCreate(childComplexity, args["input"].(PerformerCreateInput)), true
|
return e.complexity.Mutation.PerformerCreate(childComplexity, args["input"].(PerformerCreateInput)), true
|
||||||
|
|
||||||
|
case "Mutation.performerDestroy":
|
||||||
|
if e.complexity.Mutation.PerformerDestroy == nil {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
|
||||||
|
args, err := ec.field_Mutation_performerDestroy_args(context.TODO(), rawArgs)
|
||||||
|
if err != nil {
|
||||||
|
return 0, false
|
||||||
|
}
|
||||||
|
|
||||||
|
return e.complexity.Mutation.PerformerDestroy(childComplexity, args["input"].(PerformerDestroyInput)), true
|
||||||
|
|
||||||
case "Mutation.performerUpdate":
|
case "Mutation.performerUpdate":
|
||||||
if e.complexity.Mutation.PerformerUpdate == nil {
|
if e.complexity.Mutation.PerformerUpdate == nil {
|
||||||
break
|
break
|
||||||
@@ -670,6 +686,18 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in
|
|||||||
|
|
||||||
return e.complexity.Mutation.StudioCreate(childComplexity, args["input"].(StudioCreateInput)), true
|
return e.complexity.Mutation.StudioCreate(childComplexity, args["input"].(StudioCreateInput)), true
|
||||||
|
|
||||||
|
case "Mutation.studioDestroy":
|
||||||
|
if e.complexity.Mutation.StudioDestroy == nil {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
|
||||||
|
args, err := ec.field_Mutation_studioDestroy_args(context.TODO(), rawArgs)
|
||||||
|
if err != nil {
|
||||||
|
return 0, false
|
||||||
|
}
|
||||||
|
|
||||||
|
return e.complexity.Mutation.StudioDestroy(childComplexity, args["input"].(StudioDestroyInput)), true
|
||||||
|
|
||||||
case "Mutation.studioUpdate":
|
case "Mutation.studioUpdate":
|
||||||
if e.complexity.Mutation.StudioUpdate == nil {
|
if e.complexity.Mutation.StudioUpdate == nil {
|
||||||
break
|
break
|
||||||
@@ -1840,9 +1868,11 @@ type Mutation {
|
|||||||
|
|
||||||
performerCreate(input: PerformerCreateInput!): Performer
|
performerCreate(input: PerformerCreateInput!): Performer
|
||||||
performerUpdate(input: PerformerUpdateInput!): Performer
|
performerUpdate(input: PerformerUpdateInput!): Performer
|
||||||
|
performerDestroy(input: PerformerDestroyInput!): Boolean!
|
||||||
|
|
||||||
studioCreate(input: StudioCreateInput!): Studio
|
studioCreate(input: StudioCreateInput!): Studio
|
||||||
studioUpdate(input: StudioUpdateInput!): Studio
|
studioUpdate(input: StudioUpdateInput!): Studio
|
||||||
|
studioDestroy(input: StudioDestroyInput!): Boolean!
|
||||||
|
|
||||||
tagCreate(input: TagCreateInput!): Tag
|
tagCreate(input: TagCreateInput!): Tag
|
||||||
tagUpdate(input: TagUpdateInput!): Tag
|
tagUpdate(input: TagUpdateInput!): Tag
|
||||||
@@ -2054,6 +2084,10 @@ input PerformerUpdateInput {
|
|||||||
image: String
|
image: String
|
||||||
}
|
}
|
||||||
|
|
||||||
|
input PerformerDestroyInput {
|
||||||
|
id: ID!
|
||||||
|
}
|
||||||
|
|
||||||
type FindPerformersResultType {
|
type FindPerformersResultType {
|
||||||
count: Int!
|
count: Int!
|
||||||
performers: [Performer!]!
|
performers: [Performer!]!
|
||||||
@@ -2212,6 +2246,10 @@ input StudioUpdateInput {
|
|||||||
image: String
|
image: String
|
||||||
}
|
}
|
||||||
|
|
||||||
|
input StudioDestroyInput {
|
||||||
|
id: ID!
|
||||||
|
}
|
||||||
|
|
||||||
type FindStudiosResultType {
|
type FindStudiosResultType {
|
||||||
count: Int!
|
count: Int!
|
||||||
studios: [Studio!]!
|
studios: [Studio!]!
|
||||||
@@ -2270,6 +2308,20 @@ func (ec *executionContext) field_Mutation_performerCreate_args(ctx context.Cont
|
|||||||
return args, nil
|
return args, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (ec *executionContext) field_Mutation_performerDestroy_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) {
|
||||||
|
var err error
|
||||||
|
args := map[string]interface{}{}
|
||||||
|
var arg0 PerformerDestroyInput
|
||||||
|
if tmp, ok := rawArgs["input"]; ok {
|
||||||
|
arg0, err = ec.unmarshalNPerformerDestroyInput2githubᚗcomᚋstashappᚋstashᚋpkgᚋmodelsᚐPerformerDestroyInput(ctx, tmp)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
args["input"] = arg0
|
||||||
|
return args, nil
|
||||||
|
}
|
||||||
|
|
||||||
func (ec *executionContext) field_Mutation_performerUpdate_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) {
|
func (ec *executionContext) field_Mutation_performerUpdate_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) {
|
||||||
var err error
|
var err error
|
||||||
args := map[string]interface{}{}
|
args := map[string]interface{}{}
|
||||||
@@ -2354,6 +2406,20 @@ func (ec *executionContext) field_Mutation_studioCreate_args(ctx context.Context
|
|||||||
return args, nil
|
return args, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (ec *executionContext) field_Mutation_studioDestroy_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) {
|
||||||
|
var err error
|
||||||
|
args := map[string]interface{}{}
|
||||||
|
var arg0 StudioDestroyInput
|
||||||
|
if tmp, ok := rawArgs["input"]; ok {
|
||||||
|
arg0, err = ec.unmarshalNStudioDestroyInput2githubᚗcomᚋstashappᚋstashᚋpkgᚋmodelsᚐStudioDestroyInput(ctx, tmp)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
args["input"] = arg0
|
||||||
|
return args, nil
|
||||||
|
}
|
||||||
|
|
||||||
func (ec *executionContext) field_Mutation_studioUpdate_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) {
|
func (ec *executionContext) field_Mutation_studioUpdate_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) {
|
||||||
var err error
|
var err error
|
||||||
args := map[string]interface{}{}
|
args := map[string]interface{}{}
|
||||||
@@ -3625,6 +3691,40 @@ func (ec *executionContext) _Mutation_performerUpdate(ctx context.Context, field
|
|||||||
return ec.marshalOPerformer2ᚖgithubᚗcomᚋstashappᚋstashᚋpkgᚋmodelsᚐPerformer(ctx, field.Selections, res)
|
return ec.marshalOPerformer2ᚖgithubᚗcomᚋstashappᚋstashᚋpkgᚋmodelsᚐPerformer(ctx, field.Selections, res)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (ec *executionContext) _Mutation_performerDestroy(ctx context.Context, field graphql.CollectedField) graphql.Marshaler {
|
||||||
|
ctx = ec.Tracer.StartFieldExecution(ctx, field)
|
||||||
|
defer func() { ec.Tracer.EndFieldExecution(ctx) }()
|
||||||
|
rctx := &graphql.ResolverContext{
|
||||||
|
Object: "Mutation",
|
||||||
|
Field: field,
|
||||||
|
Args: nil,
|
||||||
|
IsMethod: true,
|
||||||
|
}
|
||||||
|
ctx = graphql.WithResolverContext(ctx, rctx)
|
||||||
|
rawArgs := field.ArgumentMap(ec.Variables)
|
||||||
|
args, err := ec.field_Mutation_performerDestroy_args(ctx, rawArgs)
|
||||||
|
if err != nil {
|
||||||
|
ec.Error(ctx, err)
|
||||||
|
return graphql.Null
|
||||||
|
}
|
||||||
|
rctx.Args = args
|
||||||
|
ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx)
|
||||||
|
resTmp := ec.FieldMiddleware(ctx, nil, func(rctx context.Context) (interface{}, error) {
|
||||||
|
ctx = rctx // use context from middleware stack in children
|
||||||
|
return ec.resolvers.Mutation().PerformerDestroy(rctx, args["input"].(PerformerDestroyInput))
|
||||||
|
})
|
||||||
|
if resTmp == nil {
|
||||||
|
if !ec.HasError(rctx) {
|
||||||
|
ec.Errorf(ctx, "must not be null")
|
||||||
|
}
|
||||||
|
return graphql.Null
|
||||||
|
}
|
||||||
|
res := resTmp.(bool)
|
||||||
|
rctx.Result = res
|
||||||
|
ctx = ec.Tracer.StartFieldChildExecution(ctx)
|
||||||
|
return ec.marshalNBoolean2bool(ctx, field.Selections, res)
|
||||||
|
}
|
||||||
|
|
||||||
func (ec *executionContext) _Mutation_studioCreate(ctx context.Context, field graphql.CollectedField) graphql.Marshaler {
|
func (ec *executionContext) _Mutation_studioCreate(ctx context.Context, field graphql.CollectedField) graphql.Marshaler {
|
||||||
ctx = ec.Tracer.StartFieldExecution(ctx, field)
|
ctx = ec.Tracer.StartFieldExecution(ctx, field)
|
||||||
defer func() { ec.Tracer.EndFieldExecution(ctx) }()
|
defer func() { ec.Tracer.EndFieldExecution(ctx) }()
|
||||||
@@ -3687,6 +3787,40 @@ func (ec *executionContext) _Mutation_studioUpdate(ctx context.Context, field gr
|
|||||||
return ec.marshalOStudio2ᚖgithubᚗcomᚋstashappᚋstashᚋpkgᚋmodelsᚐStudio(ctx, field.Selections, res)
|
return ec.marshalOStudio2ᚖgithubᚗcomᚋstashappᚋstashᚋpkgᚋmodelsᚐStudio(ctx, field.Selections, res)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (ec *executionContext) _Mutation_studioDestroy(ctx context.Context, field graphql.CollectedField) graphql.Marshaler {
|
||||||
|
ctx = ec.Tracer.StartFieldExecution(ctx, field)
|
||||||
|
defer func() { ec.Tracer.EndFieldExecution(ctx) }()
|
||||||
|
rctx := &graphql.ResolverContext{
|
||||||
|
Object: "Mutation",
|
||||||
|
Field: field,
|
||||||
|
Args: nil,
|
||||||
|
IsMethod: true,
|
||||||
|
}
|
||||||
|
ctx = graphql.WithResolverContext(ctx, rctx)
|
||||||
|
rawArgs := field.ArgumentMap(ec.Variables)
|
||||||
|
args, err := ec.field_Mutation_studioDestroy_args(ctx, rawArgs)
|
||||||
|
if err != nil {
|
||||||
|
ec.Error(ctx, err)
|
||||||
|
return graphql.Null
|
||||||
|
}
|
||||||
|
rctx.Args = args
|
||||||
|
ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx)
|
||||||
|
resTmp := ec.FieldMiddleware(ctx, nil, func(rctx context.Context) (interface{}, error) {
|
||||||
|
ctx = rctx // use context from middleware stack in children
|
||||||
|
return ec.resolvers.Mutation().StudioDestroy(rctx, args["input"].(StudioDestroyInput))
|
||||||
|
})
|
||||||
|
if resTmp == nil {
|
||||||
|
if !ec.HasError(rctx) {
|
||||||
|
ec.Errorf(ctx, "must not be null")
|
||||||
|
}
|
||||||
|
return graphql.Null
|
||||||
|
}
|
||||||
|
res := resTmp.(bool)
|
||||||
|
rctx.Result = res
|
||||||
|
ctx = ec.Tracer.StartFieldChildExecution(ctx)
|
||||||
|
return ec.marshalNBoolean2bool(ctx, field.Selections, res)
|
||||||
|
}
|
||||||
|
|
||||||
func (ec *executionContext) _Mutation_tagCreate(ctx context.Context, field graphql.CollectedField) graphql.Marshaler {
|
func (ec *executionContext) _Mutation_tagCreate(ctx context.Context, field graphql.CollectedField) graphql.Marshaler {
|
||||||
ctx = ec.Tracer.StartFieldExecution(ctx, field)
|
ctx = ec.Tracer.StartFieldExecution(ctx, field)
|
||||||
defer func() { ec.Tracer.EndFieldExecution(ctx) }()
|
defer func() { ec.Tracer.EndFieldExecution(ctx) }()
|
||||||
@@ -8131,6 +8265,24 @@ func (ec *executionContext) unmarshalInputPerformerCreateInput(ctx context.Conte
|
|||||||
return it, nil
|
return it, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (ec *executionContext) unmarshalInputPerformerDestroyInput(ctx context.Context, v interface{}) (PerformerDestroyInput, error) {
|
||||||
|
var it PerformerDestroyInput
|
||||||
|
var asMap = v.(map[string]interface{})
|
||||||
|
|
||||||
|
for k, v := range asMap {
|
||||||
|
switch k {
|
||||||
|
case "id":
|
||||||
|
var err error
|
||||||
|
it.ID, err = ec.unmarshalNID2string(ctx, v)
|
||||||
|
if err != nil {
|
||||||
|
return it, err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return it, nil
|
||||||
|
}
|
||||||
|
|
||||||
func (ec *executionContext) unmarshalInputPerformerFilterType(ctx context.Context, v interface{}) (PerformerFilterType, error) {
|
func (ec *executionContext) unmarshalInputPerformerFilterType(ctx context.Context, v interface{}) (PerformerFilterType, error) {
|
||||||
var it PerformerFilterType
|
var it PerformerFilterType
|
||||||
var asMap = v.(map[string]interface{})
|
var asMap = v.(map[string]interface{})
|
||||||
@@ -8557,6 +8709,24 @@ func (ec *executionContext) unmarshalInputStudioCreateInput(ctx context.Context,
|
|||||||
return it, nil
|
return it, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (ec *executionContext) unmarshalInputStudioDestroyInput(ctx context.Context, v interface{}) (StudioDestroyInput, error) {
|
||||||
|
var it StudioDestroyInput
|
||||||
|
var asMap = v.(map[string]interface{})
|
||||||
|
|
||||||
|
for k, v := range asMap {
|
||||||
|
switch k {
|
||||||
|
case "id":
|
||||||
|
var err error
|
||||||
|
it.ID, err = ec.unmarshalNID2string(ctx, v)
|
||||||
|
if err != nil {
|
||||||
|
return it, err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return it, nil
|
||||||
|
}
|
||||||
|
|
||||||
func (ec *executionContext) unmarshalInputStudioUpdateInput(ctx context.Context, v interface{}) (StudioUpdateInput, error) {
|
func (ec *executionContext) unmarshalInputStudioUpdateInput(ctx context.Context, v interface{}) (StudioUpdateInput, error) {
|
||||||
var it StudioUpdateInput
|
var it StudioUpdateInput
|
||||||
var asMap = v.(map[string]interface{})
|
var asMap = v.(map[string]interface{})
|
||||||
@@ -9045,10 +9215,20 @@ func (ec *executionContext) _Mutation(ctx context.Context, sel ast.SelectionSet)
|
|||||||
out.Values[i] = ec._Mutation_performerCreate(ctx, field)
|
out.Values[i] = ec._Mutation_performerCreate(ctx, field)
|
||||||
case "performerUpdate":
|
case "performerUpdate":
|
||||||
out.Values[i] = ec._Mutation_performerUpdate(ctx, field)
|
out.Values[i] = ec._Mutation_performerUpdate(ctx, field)
|
||||||
|
case "performerDestroy":
|
||||||
|
out.Values[i] = ec._Mutation_performerDestroy(ctx, field)
|
||||||
|
if out.Values[i] == graphql.Null {
|
||||||
|
invalids++
|
||||||
|
}
|
||||||
case "studioCreate":
|
case "studioCreate":
|
||||||
out.Values[i] = ec._Mutation_studioCreate(ctx, field)
|
out.Values[i] = ec._Mutation_studioCreate(ctx, field)
|
||||||
case "studioUpdate":
|
case "studioUpdate":
|
||||||
out.Values[i] = ec._Mutation_studioUpdate(ctx, field)
|
out.Values[i] = ec._Mutation_studioUpdate(ctx, field)
|
||||||
|
case "studioDestroy":
|
||||||
|
out.Values[i] = ec._Mutation_studioDestroy(ctx, field)
|
||||||
|
if out.Values[i] == graphql.Null {
|
||||||
|
invalids++
|
||||||
|
}
|
||||||
case "tagCreate":
|
case "tagCreate":
|
||||||
out.Values[i] = ec._Mutation_tagCreate(ctx, field)
|
out.Values[i] = ec._Mutation_tagCreate(ctx, field)
|
||||||
case "tagUpdate":
|
case "tagUpdate":
|
||||||
@@ -11010,6 +11190,10 @@ func (ec *executionContext) unmarshalNPerformerCreateInput2githubᚗcomᚋstasha
|
|||||||
return ec.unmarshalInputPerformerCreateInput(ctx, v)
|
return ec.unmarshalInputPerformerCreateInput(ctx, v)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (ec *executionContext) unmarshalNPerformerDestroyInput2githubᚗcomᚋstashappᚋstashᚋpkgᚋmodelsᚐPerformerDestroyInput(ctx context.Context, v interface{}) (PerformerDestroyInput, error) {
|
||||||
|
return ec.unmarshalInputPerformerDestroyInput(ctx, v)
|
||||||
|
}
|
||||||
|
|
||||||
func (ec *executionContext) unmarshalNPerformerUpdateInput2githubᚗcomᚋstashappᚋstashᚋpkgᚋmodelsᚐPerformerUpdateInput(ctx context.Context, v interface{}) (PerformerUpdateInput, error) {
|
func (ec *executionContext) unmarshalNPerformerUpdateInput2githubᚗcomᚋstashappᚋstashᚋpkgᚋmodelsᚐPerformerUpdateInput(ctx context.Context, v interface{}) (PerformerUpdateInput, error) {
|
||||||
return ec.unmarshalInputPerformerUpdateInput(ctx, v)
|
return ec.unmarshalInputPerformerUpdateInput(ctx, v)
|
||||||
}
|
}
|
||||||
@@ -11319,6 +11503,10 @@ func (ec *executionContext) unmarshalNStudioCreateInput2githubᚗcomᚋstashapp
|
|||||||
return ec.unmarshalInputStudioCreateInput(ctx, v)
|
return ec.unmarshalInputStudioCreateInput(ctx, v)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (ec *executionContext) unmarshalNStudioDestroyInput2githubᚗcomᚋstashappᚋstashᚋpkgᚋmodelsᚐStudioDestroyInput(ctx context.Context, v interface{}) (StudioDestroyInput, error) {
|
||||||
|
return ec.unmarshalInputStudioDestroyInput(ctx, v)
|
||||||
|
}
|
||||||
|
|
||||||
func (ec *executionContext) unmarshalNStudioUpdateInput2githubᚗcomᚋstashappᚋstashᚋpkgᚋmodelsᚐStudioUpdateInput(ctx context.Context, v interface{}) (StudioUpdateInput, error) {
|
func (ec *executionContext) unmarshalNStudioUpdateInput2githubᚗcomᚋstashappᚋstashᚋpkgᚋmodelsᚐStudioUpdateInput(ctx context.Context, v interface{}) (StudioUpdateInput, error) {
|
||||||
return ec.unmarshalInputStudioUpdateInput(ctx, v)
|
return ec.unmarshalInputStudioUpdateInput(ctx, v)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -109,6 +109,10 @@ type PerformerCreateInput struct {
|
|||||||
Image string `json:"image"`
|
Image string `json:"image"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type PerformerDestroyInput struct {
|
||||||
|
ID string `json:"id"`
|
||||||
|
}
|
||||||
|
|
||||||
type PerformerFilterType struct {
|
type PerformerFilterType struct {
|
||||||
// Filter by favorite
|
// Filter by favorite
|
||||||
FilterFavorites *bool `json:"filter_favorites"`
|
FilterFavorites *bool `json:"filter_favorites"`
|
||||||
@@ -254,6 +258,10 @@ type StudioCreateInput struct {
|
|||||||
Image string `json:"image"`
|
Image string `json:"image"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type StudioDestroyInput struct {
|
||||||
|
ID string `json:"id"`
|
||||||
|
}
|
||||||
|
|
||||||
type StudioUpdateInput struct {
|
type StudioUpdateInput struct {
|
||||||
ID string `json:"id"`
|
ID string `json:"id"`
|
||||||
Name *string `json:"name"`
|
Name *string `json:"name"`
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package models
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"database/sql"
|
"database/sql"
|
||||||
|
|
||||||
"github.com/jmoiron/sqlx"
|
"github.com/jmoiron/sqlx"
|
||||||
"github.com/stashapp/stash/pkg/database"
|
"github.com/stashapp/stash/pkg/database"
|
||||||
)
|
)
|
||||||
@@ -54,6 +55,15 @@ func (qb *PerformerQueryBuilder) Update(updatedPerformer Performer, tx *sqlx.Tx)
|
|||||||
return &updatedPerformer, nil
|
return &updatedPerformer, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (qb *PerformerQueryBuilder) Destroy(id string, tx *sqlx.Tx) error {
|
||||||
|
_, err := tx.Exec("DELETE FROM performers_scenes WHERE performer_id = ?", id)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
return executeDeleteQuery("performers", id, tx)
|
||||||
|
}
|
||||||
|
|
||||||
func (qb *PerformerQueryBuilder) Find(id int) (*Performer, error) {
|
func (qb *PerformerQueryBuilder) Find(id int) (*Performer, error) {
|
||||||
query := "SELECT * FROM performers WHERE id = ? LIMIT 1"
|
query := "SELECT * FROM performers WHERE id = ? LIMIT 1"
|
||||||
args := []interface{}{id}
|
args := []interface{}{id}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package models
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"database/sql"
|
"database/sql"
|
||||||
|
|
||||||
"github.com/jmoiron/sqlx"
|
"github.com/jmoiron/sqlx"
|
||||||
"github.com/stashapp/stash/pkg/database"
|
"github.com/stashapp/stash/pkg/database"
|
||||||
)
|
)
|
||||||
@@ -50,6 +51,22 @@ func (qb *StudioQueryBuilder) Update(updatedStudio Studio, tx *sqlx.Tx) (*Studio
|
|||||||
return &updatedStudio, nil
|
return &updatedStudio, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (qb *StudioQueryBuilder) Destroy(id string, tx *sqlx.Tx) error {
|
||||||
|
// remove studio from scenes
|
||||||
|
_, err := tx.Exec("UPDATE scenes SET studio_id = null WHERE studio_id = ?", id)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
// remove studio from scraped items
|
||||||
|
_, err = tx.Exec("UPDATE scraped_items SET studio_id = null WHERE studio_id = ?", id)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
return executeDeleteQuery("studios", id, tx)
|
||||||
|
}
|
||||||
|
|
||||||
func (qb *StudioQueryBuilder) Find(id int, tx *sqlx.Tx) (*Studio, error) {
|
func (qb *StudioQueryBuilder) Find(id int, tx *sqlx.Tx) (*Studio, error) {
|
||||||
query := "SELECT * FROM studios WHERE id = ? LIMIT 1"
|
query := "SELECT * FROM studios WHERE id = ? LIMIT 1"
|
||||||
args := []interface{}{id}
|
args := []interface{}{id}
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ interface IProps {
|
|||||||
isEditing: boolean;
|
isEditing: boolean;
|
||||||
onToggleEdit: () => void;
|
onToggleEdit: () => void;
|
||||||
onSave: () => void;
|
onSave: () => void;
|
||||||
|
onDelete: () => void;
|
||||||
onImageChange: (event: React.FormEvent<HTMLInputElement>) => void;
|
onImageChange: (event: React.FormEvent<HTMLInputElement>) => void;
|
||||||
|
|
||||||
// TODO: only for performers. make generic
|
// TODO: only for performers. make generic
|
||||||
@@ -43,6 +44,11 @@ export const DetailsEditNavbar: FunctionComponent<IProps> = (props: IProps) => {
|
|||||||
return <Button intent="success" text="Save" onClick={() => props.onSave()} />;
|
return <Button intent="success" text="Save" onClick={() => props.onSave()} />;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function renderDeleteButton() {
|
||||||
|
if (props.isNew || props.isEditing) { return; }
|
||||||
|
return <Button intent="danger" text="Delete" onClick={() => props.onDelete()} />;
|
||||||
|
}
|
||||||
|
|
||||||
function renderImageInput() {
|
function renderImageInput() {
|
||||||
if (!props.isEditing) { return; }
|
if (!props.isEditing) { return; }
|
||||||
return <FileInput text="Choose image..." onInputChange={props.onImageChange} inputProps={{accept: ".jpg,.jpeg"}} />;
|
return <FileInput text="Choose image..." onInputChange={props.onImageChange} inputProps={{accept: ".jpg,.jpeg"}} />;
|
||||||
@@ -91,6 +97,7 @@ export const DetailsEditNavbar: FunctionComponent<IProps> = (props: IProps) => {
|
|||||||
{renderSaveButton()}
|
{renderSaveButton()}
|
||||||
|
|
||||||
{renderScenesButton()}
|
{renderScenesButton()}
|
||||||
|
{renderDeleteButton()}
|
||||||
</Navbar.Group>
|
</Navbar.Group>
|
||||||
</Navbar>
|
</Navbar>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -39,6 +39,7 @@ export const Studio: FunctionComponent<IProps> = (props: IProps) => {
|
|||||||
const { data, error, loading } = StashService.useFindStudio(props.match.params.id);
|
const { data, error, loading } = StashService.useFindStudio(props.match.params.id);
|
||||||
const updateStudio = StashService.useStudioUpdate(getStudioInput() as GQL.StudioUpdateInput);
|
const updateStudio = StashService.useStudioUpdate(getStudioInput() as GQL.StudioUpdateInput);
|
||||||
const createStudio = StashService.useStudioCreate(getStudioInput() as GQL.StudioCreateInput);
|
const createStudio = StashService.useStudioCreate(getStudioInput() as GQL.StudioCreateInput);
|
||||||
|
const deleteStudio = StashService.useStudioDestroy(getStudioInput() as GQL.StudioDestroyInput);
|
||||||
|
|
||||||
function updateStudioEditState(state: Partial<GQL.StudioDataFragment>) {
|
function updateStudioEditState(state: Partial<GQL.StudioDataFragment>) {
|
||||||
setName(state.name);
|
setName(state.name);
|
||||||
@@ -95,6 +96,19 @@ export const Studio: FunctionComponent<IProps> = (props: IProps) => {
|
|||||||
setIsLoading(false);
|
setIsLoading(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function onDelete() {
|
||||||
|
setIsLoading(true);
|
||||||
|
try {
|
||||||
|
const result = await deleteStudio();
|
||||||
|
} catch (e) {
|
||||||
|
ErrorUtils.handle(e);
|
||||||
|
}
|
||||||
|
setIsLoading(false);
|
||||||
|
|
||||||
|
// redirect to studios page
|
||||||
|
props.history.push(`/studios`);
|
||||||
|
}
|
||||||
|
|
||||||
function onImageChange(event: React.FormEvent<HTMLInputElement>) {
|
function onImageChange(event: React.FormEvent<HTMLInputElement>) {
|
||||||
const file: File = (event.target as any).files[0];
|
const file: File = (event.target as any).files[0];
|
||||||
const reader: FileReader = new FileReader();
|
const reader: FileReader = new FileReader();
|
||||||
@@ -120,6 +134,7 @@ export const Studio: FunctionComponent<IProps> = (props: IProps) => {
|
|||||||
isEditing={isEditing}
|
isEditing={isEditing}
|
||||||
onToggleEdit={() => { setIsEditing(!isEditing); updateStudioEditState(studio); }}
|
onToggleEdit={() => { setIsEditing(!isEditing); updateStudioEditState(studio); }}
|
||||||
onSave={onSave}
|
onSave={onSave}
|
||||||
|
onDelete={onDelete}
|
||||||
onImageChange={onImageChange}
|
onImageChange={onImageChange}
|
||||||
/>
|
/>
|
||||||
<h1 className="bp3-heading">
|
<h1 className="bp3-heading">
|
||||||
|
|||||||
@@ -55,6 +55,7 @@ export const Performer: FunctionComponent<IPerformerProps> = (props: IPerformerP
|
|||||||
const { data, error, loading } = StashService.useFindPerformer(props.match.params.id);
|
const { data, error, loading } = StashService.useFindPerformer(props.match.params.id);
|
||||||
const updatePerformer = StashService.usePerformerUpdate(getPerformerInput() as GQL.PerformerUpdateInput);
|
const updatePerformer = StashService.usePerformerUpdate(getPerformerInput() as GQL.PerformerUpdateInput);
|
||||||
const createPerformer = StashService.usePerformerCreate(getPerformerInput() as GQL.PerformerCreateInput);
|
const createPerformer = StashService.usePerformerCreate(getPerformerInput() as GQL.PerformerCreateInput);
|
||||||
|
const deletePerformer = StashService.usePerformerDestroy(getPerformerInput() as GQL.PerformerDestroyInput);
|
||||||
|
|
||||||
function updatePerformerEditState(state: Partial<GQL.PerformerDataFragment | GQL.ScrapeFreeonesScrapeFreeones>) {
|
function updatePerformerEditState(state: Partial<GQL.PerformerDataFragment | GQL.ScrapeFreeonesScrapeFreeones>) {
|
||||||
if ((state as GQL.PerformerDataFragment).favorite !== undefined) {
|
if ((state as GQL.PerformerDataFragment).favorite !== undefined) {
|
||||||
@@ -141,6 +142,19 @@ export const Performer: FunctionComponent<IPerformerProps> = (props: IPerformerP
|
|||||||
setIsLoading(false);
|
setIsLoading(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function onDelete() {
|
||||||
|
setIsLoading(true);
|
||||||
|
try {
|
||||||
|
const result = await deletePerformer();
|
||||||
|
} catch (e) {
|
||||||
|
ErrorUtils.handle(e);
|
||||||
|
}
|
||||||
|
setIsLoading(false);
|
||||||
|
|
||||||
|
// redirect to performers page
|
||||||
|
props.history.push(`/performers`);
|
||||||
|
}
|
||||||
|
|
||||||
function onImageChange(event: React.FormEvent<HTMLInputElement>) {
|
function onImageChange(event: React.FormEvent<HTMLInputElement>) {
|
||||||
const file: File = (event.target as any).files[0];
|
const file: File = (event.target as any).files[0];
|
||||||
const reader: FileReader = new FileReader();
|
const reader: FileReader = new FileReader();
|
||||||
@@ -218,6 +232,7 @@ export const Performer: FunctionComponent<IPerformerProps> = (props: IPerformerP
|
|||||||
isEditing={isEditing}
|
isEditing={isEditing}
|
||||||
onToggleEdit={() => { setIsEditing(!isEditing); updatePerformerEditState(performer); }}
|
onToggleEdit={() => { setIsEditing(!isEditing); updatePerformerEditState(performer); }}
|
||||||
onSave={onSave}
|
onSave={onSave}
|
||||||
|
onDelete={onDelete}
|
||||||
onImageChange={onImageChange}
|
onImageChange={onImageChange}
|
||||||
onDisplayFreeOnesDialog={onDisplayFreeOnesDialog}
|
onDisplayFreeOnesDialog={onDisplayFreeOnesDialog}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -133,6 +133,9 @@ export class StashService {
|
|||||||
public static usePerformerUpdate(input: GQL.PerformerUpdateInput) {
|
public static usePerformerUpdate(input: GQL.PerformerUpdateInput) {
|
||||||
return GQL.usePerformerUpdate({ variables: input });
|
return GQL.usePerformerUpdate({ variables: input });
|
||||||
}
|
}
|
||||||
|
public static usePerformerDestroy(input: GQL.PerformerDestroyInput) {
|
||||||
|
return GQL.usePerformerDestroy({ variables: input });
|
||||||
|
}
|
||||||
|
|
||||||
public static useSceneUpdate(input: GQL.SceneUpdateInput) {
|
public static useSceneUpdate(input: GQL.SceneUpdateInput) {
|
||||||
return GQL.useSceneUpdate({ variables: input });
|
return GQL.useSceneUpdate({ variables: input });
|
||||||
@@ -144,6 +147,9 @@ export class StashService {
|
|||||||
public static useStudioUpdate(input: GQL.StudioUpdateInput) {
|
public static useStudioUpdate(input: GQL.StudioUpdateInput) {
|
||||||
return GQL.useStudioUpdate({ variables: input });
|
return GQL.useStudioUpdate({ variables: input });
|
||||||
}
|
}
|
||||||
|
public static useStudioDestroy(input: GQL.StudioDestroyInput) {
|
||||||
|
return GQL.useStudioDestroy({ variables: input });
|
||||||
|
}
|
||||||
|
|
||||||
public static useTagCreate(input: GQL.TagCreateInput) {
|
public static useTagCreate(input: GQL.TagCreateInput) {
|
||||||
return GQL.useTagCreate({ variables: input, refetchQueries: ["AllTags"] });
|
return GQL.useTagCreate({ variables: input, refetchQueries: ["AllTags"] });
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/* tslint:disable */
|
/* tslint:disable */
|
||||||
/* eslint-disable */
|
/* eslint-disable */
|
||||||
// Generated in 2019-05-27T11:23:10-07:00
|
// Generated in 2019-08-14T07:29:27+10:00
|
||||||
export type Maybe<T> = T | undefined;
|
export type Maybe<T> = T | undefined;
|
||||||
|
|
||||||
export interface SceneFilterType {
|
export interface SceneFilterType {
|
||||||
@@ -188,6 +188,10 @@ export interface PerformerUpdateInput {
|
|||||||
image?: Maybe<string>;
|
image?: Maybe<string>;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface PerformerDestroyInput {
|
||||||
|
id: string;
|
||||||
|
}
|
||||||
|
|
||||||
export interface StudioCreateInput {
|
export interface StudioCreateInput {
|
||||||
name: string;
|
name: string;
|
||||||
|
|
||||||
@@ -206,6 +210,10 @@ export interface StudioUpdateInput {
|
|||||||
image?: Maybe<string>;
|
image?: Maybe<string>;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface StudioDestroyInput {
|
||||||
|
id: string;
|
||||||
|
}
|
||||||
|
|
||||||
export interface TagCreateInput {
|
export interface TagCreateInput {
|
||||||
name: string;
|
name: string;
|
||||||
}
|
}
|
||||||
@@ -326,6 +334,16 @@ export type PerformerUpdateMutation = {
|
|||||||
|
|
||||||
export type PerformerUpdatePerformerUpdate = PerformerDataFragment;
|
export type PerformerUpdatePerformerUpdate = PerformerDataFragment;
|
||||||
|
|
||||||
|
export type PerformerDestroyVariables = {
|
||||||
|
id: string;
|
||||||
|
};
|
||||||
|
|
||||||
|
export type PerformerDestroyMutation = {
|
||||||
|
__typename?: "Mutation";
|
||||||
|
|
||||||
|
performerDestroy: boolean;
|
||||||
|
};
|
||||||
|
|
||||||
export type SceneMarkerCreateVariables = {
|
export type SceneMarkerCreateVariables = {
|
||||||
title: string;
|
title: string;
|
||||||
seconds: number;
|
seconds: number;
|
||||||
@@ -419,6 +437,16 @@ export type StudioUpdateMutation = {
|
|||||||
|
|
||||||
export type StudioUpdateStudioUpdate = StudioDataFragment;
|
export type StudioUpdateStudioUpdate = StudioDataFragment;
|
||||||
|
|
||||||
|
export type StudioDestroyVariables = {
|
||||||
|
id: string;
|
||||||
|
};
|
||||||
|
|
||||||
|
export type StudioDestroyMutation = {
|
||||||
|
__typename?: "Mutation";
|
||||||
|
|
||||||
|
studioDestroy: boolean;
|
||||||
|
};
|
||||||
|
|
||||||
export type TagCreateVariables = {
|
export type TagCreateVariables = {
|
||||||
name: string;
|
name: string;
|
||||||
};
|
};
|
||||||
@@ -1644,6 +1672,22 @@ export function usePerformerUpdate(
|
|||||||
PerformerUpdateVariables
|
PerformerUpdateVariables
|
||||||
>(PerformerUpdateDocument, baseOptions);
|
>(PerformerUpdateDocument, baseOptions);
|
||||||
}
|
}
|
||||||
|
export const PerformerDestroyDocument = gql`
|
||||||
|
mutation PerformerDestroy($id: ID!) {
|
||||||
|
performerDestroy(input: { id: $id })
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
export function usePerformerDestroy(
|
||||||
|
baseOptions?: ReactApolloHooks.MutationHookOptions<
|
||||||
|
PerformerDestroyMutation,
|
||||||
|
PerformerDestroyVariables
|
||||||
|
>
|
||||||
|
) {
|
||||||
|
return ReactApolloHooks.useMutation<
|
||||||
|
PerformerDestroyMutation,
|
||||||
|
PerformerDestroyVariables
|
||||||
|
>(PerformerDestroyDocument, baseOptions);
|
||||||
|
}
|
||||||
export const SceneMarkerCreateDocument = gql`
|
export const SceneMarkerCreateDocument = gql`
|
||||||
mutation SceneMarkerCreate(
|
mutation SceneMarkerCreate(
|
||||||
$title: String!
|
$title: String!
|
||||||
@@ -1814,6 +1858,22 @@ export function useStudioUpdate(
|
|||||||
StudioUpdateVariables
|
StudioUpdateVariables
|
||||||
>(StudioUpdateDocument, baseOptions);
|
>(StudioUpdateDocument, baseOptions);
|
||||||
}
|
}
|
||||||
|
export const StudioDestroyDocument = gql`
|
||||||
|
mutation StudioDestroy($id: ID!) {
|
||||||
|
studioDestroy(input: { id: $id })
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
export function useStudioDestroy(
|
||||||
|
baseOptions?: ReactApolloHooks.MutationHookOptions<
|
||||||
|
StudioDestroyMutation,
|
||||||
|
StudioDestroyVariables
|
||||||
|
>
|
||||||
|
) {
|
||||||
|
return ReactApolloHooks.useMutation<
|
||||||
|
StudioDestroyMutation,
|
||||||
|
StudioDestroyVariables
|
||||||
|
>(StudioDestroyDocument, baseOptions);
|
||||||
|
}
|
||||||
export const TagCreateDocument = gql`
|
export const TagCreateDocument = gql`
|
||||||
mutation TagCreate($name: String!) {
|
mutation TagCreate($name: String!) {
|
||||||
tagCreate(input: { name: $name }) {
|
tagCreate(input: { name: $name }) {
|
||||||
|
|||||||
Reference in New Issue
Block a user