mirror of
https://github.com/directus/directus.git
synced 2026-04-03 03:00:39 -04:00
@@ -143,10 +143,13 @@ export function useItem(collection: Ref<string>, primaryKey: Ref<string | number
|
||||
const response = await api.post(endpoint.value, newItem);
|
||||
|
||||
notify({
|
||||
title: i18n.t('item_create_success'),
|
||||
title: i18n.tc('item_create_success', 1),
|
||||
type: 'success',
|
||||
});
|
||||
|
||||
// Reset edits to the current item
|
||||
edits.value = {};
|
||||
|
||||
return primaryKeyField.value ? response.data.data[primaryKeyField.value.field] : null;
|
||||
} catch (err) {
|
||||
if (err?.response?.data?.errors) {
|
||||
|
||||
@@ -66,7 +66,7 @@ export default defineComponent({
|
||||
},
|
||||
type: {
|
||||
type: String,
|
||||
validator: (val: string) => ['text', 'string'].includes(val),
|
||||
validator: (val: string) => ['text', 'string', 'json', 'csv'].includes(val),
|
||||
},
|
||||
},
|
||||
setup(props) {
|
||||
|
||||
Reference in New Issue
Block a user