Skip to content

Commit

Permalink
Adding disambiguation field to performer draft (#709)
Browse files Browse the repository at this point in the history
  • Loading branch information
Flashy78 authored Feb 19, 2024
1 parent e099cef commit 95a343b
Show file tree
Hide file tree
Showing 8 changed files with 75 additions and 2 deletions.
1 change: 1 addition & 0 deletions frontend/src/graphql/queries/Draft.gql
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ query Draft($id: ID!) {
... on PerformerDraft {
id
name
disambiguation
aliases
gender
birthdate
Expand Down
7 changes: 7 additions & 0 deletions frontend/src/graphql/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -809,6 +809,7 @@ export type PerformerDraft = {
career_end_year?: Maybe<Scalars["Int"]>;
career_start_year?: Maybe<Scalars["Int"]>;
country?: Maybe<Scalars["String"]>;
disambiguation?: Maybe<Scalars["String"]>;
ethnicity?: Maybe<Scalars["String"]>;
eye_color?: Maybe<Scalars["String"]>;
gender?: Maybe<Scalars["String"]>;
Expand All @@ -830,6 +831,7 @@ export type PerformerDraftInput = {
career_end_year?: InputMaybe<Scalars["Int"]>;
career_start_year?: InputMaybe<Scalars["Int"]>;
country?: InputMaybe<Scalars["String"]>;
disambiguation?: InputMaybe<Scalars["String"]>;
ethnicity?: InputMaybe<Scalars["String"]>;
eye_color?: InputMaybe<Scalars["String"]>;
gender?: InputMaybe<Scalars["String"]>;
Expand Down Expand Up @@ -13896,6 +13898,7 @@ export type DraftQuery = {
__typename: "PerformerDraft";
id?: string | null;
name: string;
disambiguation?: string | null;
aliases?: string | null;
gender?: string | null;
birthdate?: string | null;
Expand Down Expand Up @@ -39225,6 +39228,10 @@ export const DraftDocument = {
kind: "Field",
name: { kind: "Name", value: "name" },
},
{
kind: "Field",
name: { kind: "Name", value: "disambiguation" },
},
{
kind: "Field",
name: { kind: "Name", value: "aliases" },
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/pages/drafts/parse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ export const parsePerformerDraft = (

const performer: InitialPerformer = {
name: draft.name,
disambiguation: null,
disambiguation: draft.disambiguation ?? null,
images: joinImages(draft.image, existingPerformer?.images),
gender: parseEnum(draft.gender, GenderEnum) as GenderEnum | null,
ethnicity: parseEnum(
Expand Down
2 changes: 2 additions & 0 deletions graphql/schema/types/performer.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,7 @@ input PerformerQueryInput {
type PerformerDraft {
id: ID
name: String!
disambiguation: String
aliases: String
gender: String
birthdate: String
Expand All @@ -388,6 +389,7 @@ type PerformerDraft {

input PerformerDraftInput {
id: ID
disambiguation: String
name: String!
aliases: String
gender: String
Expand Down
1 change: 1 addition & 0 deletions pkg/api/resolver_mutation_draft.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ func (r *mutationResolver) SubmitPerformerDraft(ctx context.Context, input model
data := models.PerformerDraft{
ID: input.ID,
Name: input.Name,
Disambiguation: input.Disambiguation,
Aliases: input.Aliases,
Gender: input.Gender,
Birthdate: input.Birthdate,
Expand Down
62 changes: 61 additions & 1 deletion pkg/models/generated_exec.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions pkg/models/generated_models.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions pkg/models/model_draft.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ func (SceneDraft) IsDraftData() {}
type PerformerDraft struct {
ID *uuid.UUID `json:"id,omitempty"`
Name string `json:"name"`
Disambiguation *string `json:"disambiguation,omitempty"`
Aliases *string `json:"aliases,omitempty"`
Gender *string `json:"gender,omitempty"`
Birthdate *string `json:"birthdate,omitempty"`
Expand Down

0 comments on commit 95a343b

Please sign in to comment.