chore: plugin lint fixes (#7947)
This commit is contained in:
@@ -26,7 +26,8 @@ export const deleteFromSearch: CollectionAfterDeleteHook = async ({
|
||||
}
|
||||
} catch (err: unknown) {
|
||||
payload.logger.error({
|
||||
err: `Error deleting search doc: ${err}`,
|
||||
err,
|
||||
msg: `Error deleting search doc.`,
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -141,7 +141,7 @@ export const syncWithSearch: SyncWithSearch = async (args) => {
|
||||
req,
|
||||
})
|
||||
} catch (err: unknown) {
|
||||
payload.logger.error(`Error deleting search document: ${err}`)
|
||||
payload.logger.error({ err, msg: `Error deleting search document.` })
|
||||
}
|
||||
}
|
||||
} else if (doSync) {
|
||||
@@ -155,17 +155,18 @@ export const syncWithSearch: SyncWithSearch = async (args) => {
|
||||
req,
|
||||
})
|
||||
} catch (err: unknown) {
|
||||
payload.logger.error(`Error creating search document: ${err}`)
|
||||
payload.logger.error({ err, msg: `Error creating search document.` })
|
||||
}
|
||||
}
|
||||
} catch (err: unknown) {
|
||||
payload.logger.error(`Error finding search document: ${err}`)
|
||||
payload.logger.error({ err, msg: `Error finding search document.` })
|
||||
}
|
||||
}
|
||||
} catch (err: unknown) {
|
||||
payload.logger.error(
|
||||
`Error syncing search document related to ${collection} with id: '${id}': ${err}`,
|
||||
)
|
||||
payload.logger.error({
|
||||
err,
|
||||
msg: `Error syncing search document related to ${collection} with id: '${id}'.`,
|
||||
})
|
||||
}
|
||||
|
||||
return doc
|
||||
|
||||
@@ -1,32 +1,12 @@
|
||||
'use client'
|
||||
|
||||
import type { FormState } from 'payload'
|
||||
|
||||
import { useConfig, useWatchForm } from '@payloadcms/ui'
|
||||
import { useConfig } from '@payloadcms/ui'
|
||||
import { formatAdminURL } from '@payloadcms/ui/shared'
|
||||
import React from 'react'
|
||||
// TODO: fix this import to work in dev mode within the monorepo in a way that is backwards compatible with 1.x
|
||||
// import CopyToClipboard from 'payload/dist/admin/components/elements/CopyToClipboard'
|
||||
|
||||
type FieldsWithDoc = {
|
||||
doc: {
|
||||
value: {
|
||||
relationTo: string
|
||||
value: string
|
||||
}
|
||||
}
|
||||
} & FormState
|
||||
|
||||
export const LinkToDocClient: React.FC = () => {
|
||||
const form = useWatchForm()
|
||||
const fields = form.fields as FieldsWithDoc
|
||||
|
||||
const {
|
||||
doc: {
|
||||
value: { relationTo, value: docId },
|
||||
},
|
||||
} = fields
|
||||
|
||||
const { config } = useConfig()
|
||||
|
||||
const {
|
||||
|
||||
Reference in New Issue
Block a user