@bindu-dashing/dam-solution-v2 5.9.257 → 5.9.259
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -50,6 +50,10 @@ const ImageEditorComponent = ({ file, handleClose, }) => {
|
|
|
50
50
|
const invalidateAfterChange = () => {
|
|
51
51
|
invalidateData(queryClient, generateFoldersQueryKey(type), currentFolderId);
|
|
52
52
|
invalidateData(queryClient, QueryKeys.FILE, get(file, "_id"));
|
|
53
|
+
// Image picker uses ["image-pickers", id] as its own query key,
|
|
54
|
+
// so the above invalidations don't refresh the picker grid. Hit it
|
|
55
|
+
// by prefix so we don't need to know the specific picker id here.
|
|
56
|
+
queryClient.invalidateQueries({ queryKey: [QueryKeys.IMAGE_PICKERS] });
|
|
53
57
|
};
|
|
54
58
|
const handleOverwrite = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
55
59
|
var _a;
|
|
@@ -131,8 +135,15 @@ const ImageEditorComponent = ({ file, handleClose, }) => {
|
|
|
131
135
|
setState((prev) => (Object.assign(Object.assign({}, prev), { loading: false })));
|
|
132
136
|
return;
|
|
133
137
|
}
|
|
134
|
-
// 3) register the file in the DB so it shows up in the folder grid
|
|
138
|
+
// 3) register the file in the DB so it shows up in the folder grid.
|
|
139
|
+
// Inherit assetId / metadata / teamIds from the original file so the new
|
|
140
|
+
// one belongs to the same asset template and keeps the same field values.
|
|
141
|
+
const inheritedMetadata = get(file, "metadata") || {};
|
|
142
|
+
const inheritedTeamIds = get(file, "teamIds") || [];
|
|
135
143
|
yield api.post(CREATE_FILE_URL, {
|
|
144
|
+
assetId: get(file, "assetId"),
|
|
145
|
+
teamIds: inheritedTeamIds,
|
|
146
|
+
metadata: inheritedMetadata,
|
|
136
147
|
folderId: currentFolderId,
|
|
137
148
|
files: [
|
|
138
149
|
{
|
|
@@ -140,8 +151,8 @@ const ImageEditorComponent = ({ file, handleClose, }) => {
|
|
|
140
151
|
path: filePath,
|
|
141
152
|
size: editedFile.size,
|
|
142
153
|
mimetype,
|
|
143
|
-
metadata:
|
|
144
|
-
teamIds:
|
|
154
|
+
metadata: inheritedMetadata,
|
|
155
|
+
teamIds: inheritedTeamIds,
|
|
145
156
|
},
|
|
146
157
|
],
|
|
147
158
|
});
|