feat: implement update news functionality with API integration and form handling
This commit is contained in:
@@ -21,12 +21,9 @@ export const createNewsRequest = async (parameters: TParameter) => {
|
||||
const transformedPayload = {
|
||||
...restPayload,
|
||||
categories: categories.map((category) => category?.id),
|
||||
tags: tags?.map((tag) => tag?.id),
|
||||
tags: tags?.map((tag) => tag?.id) || [],
|
||||
live_at: new Date(payload?.live_at).toISOString(),
|
||||
}
|
||||
if (transformedPayload.tags?.length === 0) {
|
||||
delete transformedPayload.tags
|
||||
}
|
||||
const { data } = await HttpServer({ accessToken }).post(
|
||||
'/api/news/create',
|
||||
transformedPayload,
|
||||
|
||||
Reference in New Issue
Block a user