Add user interface (#549)

This commit is contained in:
Rijk van Zanten
2020-05-11 13:23:41 -04:00
committed by GitHub
parent 62ef2bb59a
commit 648c2a4e0b
4 changed files with 441 additions and 3 deletions

View File

@@ -111,10 +111,12 @@ export default defineComponent({
loading.value = true;
const endpoint = props.collection.startsWith('directus_')
? `/${currentProjectKey}/${props.collection.substring(9)}/${props.primaryKey}`
: `/${currentProjectKey}/items/${props.collection}/${props.primaryKey}`;
try {
const response = await api.get(
`/${currentProjectKey}/items/${props.collection}/${props.primaryKey}`
);
const response = await api.get(endpoint);
item.value = response.data.data;
} catch (err) {