Skip to content

Commit

Permalink
fix(is_searchable): mettre les documents searchable par défaut à la c…
Browse files Browse the repository at this point in the history
…réation (#1181)
  • Loading branch information
m-maillot authored Dec 18, 2023
1 parent 720219d commit ba7dc37
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions shared/types/documents.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export type Document<T> = {
title: string;
meta_description: string;
is_available: boolean;
is_searchable: boolean;
};

export type ShortDocument<T> = Pick<
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@ export const mapContributionToDocument = async (
slug:
document?.slug ??
generateContributionSlug(data.agreement.id, data.question.content),
is_searchable: document
? document.is_searchable
: data.agreement.id === "0000",
is_available: true,
document: doc,
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export const documentsPublishMutation = `
meta_description
slug
source
is_searchable
is_available
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ export class DocumentsService {
title: data.title,
text: data.title,
slug: document?.slug ?? slugify(data.title),
is_searchable: document ? document.is_searchable : true,
is_available: true,
document: {
date: data.updatedAt
Expand Down Expand Up @@ -128,8 +129,8 @@ export class DocumentsService {
title: data.title,
text: data.description,
slug: document?.slug ?? slugify(data.title),
is_searchable: document ? document.is_searchable : true,
is_available: true,

document: {
meta_title: data.metaTitle,
type: data.type,
Expand Down

0 comments on commit ba7dc37

Please sign in to comment.