Closed alexandrudanpop closed 2 months ago
Hi @alexandrudanpop,
thanks for your feedback! Could you please include the whole request (including the payload). Best case you could supply the request as curl
which is not working as intended.
Thanks for answering @LenKlose. This is the call I make using the SDK. The call works updating the properties but not the category.
Looking at the SDK it looks like the param categoryId
is not used.
import { DmsObject, updateDmsObject } from "@dvelop-sdk/dms";
await updateDmsObject(
{
systemBaseUri,
authSessionId,
},
{
repositoryId: dmsObject.repositoryId,
sourceId: dmsObject.sourceId,
dmsObjectId: dmsObject.dmsObjectId,
alterationText: `...`,
categoryId: destinationCategoryId,
properties: newProperties,
}
);
I created my own HTTP call for it but it would be nice if it worked in the SDK.
export const updateDmsObjectAndCategory = async (
systemBaseUri: string,
authSessionId: string,
destinationCategoryId: string,
destinationCategory: string,
dmsObject: DmsObject,
newProperties: { key: string; values: string[] }[]
) => {
return axios.put(
`${systemBaseUri}/dms/r/${dmsObject.repositoryId}/o2m/${dmsObject.dmsObjectId}`,
{
alterationText: `...`,
sourceId: dmsObject.sourceId,
sourceCategory: destinationCategoryId,
sourceProperties: {
properties: newProperties,
},
},
{
headers: {
Authorization: `Bearer ${authSessionId}`,
},
timeout: REQUEST_TIMEOUT,
timeoutErrorMessage: "...",
}
);
};
Hi @alexandrudanpop ,
the problem should be fixed in @dvelop-sdk/dms@1.5.5
Could you please verify, it works for your scenario now, by testing it after running npm i @dvleop-sdk/dms@next
. We will then shortly tag the fixed version as latest
From my brief testing this works, thanks for the prompt fix @LenKlose !
When using the SDK
updateDmsObject
function, I noticed that the category is not updated. Could this be checked? Thanks for considering my request.https://github.com/d-velop/dvelop-sdk-node/blob/main/packages/dms/src/dms-objects/update-dms-object/update-dms-object.ts#L19