mirror of
https://github.com/strapi/strapi.git
synced 2025-11-10 07:10:11 +00:00
fix(history): update type (#19878)
This commit is contained in:
parent
c4ec62a341
commit
c184e9d81f
@ -1,5 +1,5 @@
|
|||||||
import { difference, omit } from 'lodash/fp';
|
import { difference, omit } from 'lodash/fp';
|
||||||
import { Schema } from '@strapi/types';
|
import type { Struct } from '@strapi/types';
|
||||||
import { CreateHistoryVersion } from '../../../../shared/contracts/history-versions';
|
import { CreateHistoryVersion } from '../../../../shared/contracts/history-versions';
|
||||||
import { FIELDS_TO_IGNORE } from '../constants';
|
import { FIELDS_TO_IGNORE } from '../constants';
|
||||||
|
|
||||||
@ -9,13 +9,10 @@ import { FIELDS_TO_IGNORE } from '../constants';
|
|||||||
*/
|
*/
|
||||||
export const getSchemaAttributesDiff = (
|
export const getSchemaAttributesDiff = (
|
||||||
versionSchemaAttributes: CreateHistoryVersion['schema'],
|
versionSchemaAttributes: CreateHistoryVersion['schema'],
|
||||||
contentTypeSchemaAttributes: Schema.Attributes
|
contentTypeSchemaAttributes: Struct.SchemaAttributes
|
||||||
) => {
|
) => {
|
||||||
// Omit the same fields that were omitted when creating a history version
|
// Omit the same fields that were omitted when creating a history version
|
||||||
const sanitizedContentTypeSchemaAttributes = omit(
|
const sanitizedContentTypeSchemaAttributes = omit(FIELDS_TO_IGNORE, contentTypeSchemaAttributes);
|
||||||
FIELDS_TO_IGNORE,
|
|
||||||
contentTypeSchemaAttributes
|
|
||||||
) as CreateHistoryVersion['schema'];
|
|
||||||
|
|
||||||
const reduceDifferenceToAttributesObject = (
|
const reduceDifferenceToAttributesObject = (
|
||||||
diffKeys: string[],
|
diffKeys: string[],
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user