@selfcommunity/react-ui 0.7.50-events.54 → 0.7.50-events.55

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.
@@ -116,13 +116,14 @@ function Share(props) {
116
116
  if (shareMedias.length) {
117
117
  sharedObjectId = shareMedias[0].embed.metadata.id;
118
118
  }
119
+ const isMediaEvent = obj.medias.some((media) => media.embed.embed_type === Media_1.MEDIA_EMBED_SC_SHARED_EVENT);
119
120
  return api_services_1.http
120
121
  .request({
121
122
  url: api_services_1.Endpoints.ComposerMediaCreate.url(),
122
123
  method: api_services_1.Endpoints.ComposerMediaCreate.method,
123
124
  data: {
124
125
  type: Media_1.MEDIA_TYPE_SHARE,
125
- shared_object: sharedObjectId
126
+ [isMediaEvent ? 'event_object' : 'shared_object']: sharedObjectId
126
127
  }
127
128
  })
128
129
  .then((res) => {
@@ -133,7 +134,7 @@ function Share(props) {
133
134
  });
134
135
  }, [obj]);
135
136
  /**
136
- * Performs the contribute sharing
137
+ * Performs the contribution sharing
137
138
  */
138
139
  function share(inCategories) {
139
140
  if (!scUserContext.user) {
@@ -9,7 +9,7 @@ import { styled } from '@mui/material/styles';
9
9
  import { Box, Button, Divider, ListItemText, Menu, SwipeableDrawer, Tooltip, useMediaQuery, useTheme } from '@mui/material';
10
10
  import MenuItem from '@mui/material/MenuItem';
11
11
  import ListItemIcon from '@mui/material/ListItemIcon';
12
- import { MEDIA_TYPE_SHARE } from '../../../../constants/Media';
12
+ import { MEDIA_EMBED_SC_SHARED_EVENT, MEDIA_TYPE_SHARE } from '../../../../constants/Media';
13
13
  import { SCOPE_SC_UI } from '../../../../constants/Errors';
14
14
  import classNames from 'classnames';
15
15
  import { useSnackbar } from 'notistack';
@@ -114,13 +114,14 @@ export default function Share(props) {
114
114
  if (shareMedias.length) {
115
115
  sharedObjectId = shareMedias[0].embed.metadata.id;
116
116
  }
117
+ const isMediaEvent = obj.medias.some((media) => media.embed.embed_type === MEDIA_EMBED_SC_SHARED_EVENT);
117
118
  return http
118
119
  .request({
119
120
  url: Endpoints.ComposerMediaCreate.url(),
120
121
  method: Endpoints.ComposerMediaCreate.method,
121
122
  data: {
122
123
  type: MEDIA_TYPE_SHARE,
123
- shared_object: sharedObjectId
124
+ [isMediaEvent ? 'event_object' : 'shared_object']: sharedObjectId
124
125
  }
125
126
  })
126
127
  .then((res) => {
@@ -131,7 +132,7 @@ export default function Share(props) {
131
132
  });
132
133
  }, [obj]);
133
134
  /**
134
- * Performs the contribute sharing
135
+ * Performs the contribution sharing
135
136
  */
136
137
  function share(inCategories) {
137
138
  if (!scUserContext.user) {