fix: update createNewsRequest to use category and tag IDs instead of codes
This commit is contained in:
parent
414806734d
commit
c6149f1bd5
@ -20,8 +20,8 @@ export const createNewsRequest = async (parameters: TParameter) => {
|
|||||||
const { categories, tags, ...restPayload } = payload
|
const { categories, tags, ...restPayload } = payload
|
||||||
const transformedPayload = {
|
const transformedPayload = {
|
||||||
...restPayload,
|
...restPayload,
|
||||||
categories: categories.map((category) => category?.code),
|
categories: categories.map((category) => category?.id),
|
||||||
tags: tags?.map((tag) => tag?.code),
|
tags: tags?.map((tag) => tag?.id),
|
||||||
live_at: new Date(payload?.live_at).toISOString(),
|
live_at: new Date(payload?.live_at).toISOString(),
|
||||||
}
|
}
|
||||||
if (transformedPayload.tags?.length === 0) {
|
if (transformedPayload.tags?.length === 0) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user