Allow views to refresh individual rows after executing row actions

This commit is contained in:
Andrew Kingston 2024-09-20 15:50:08 +01:00
parent e663a80020
commit 2d1662c0c7
No known key found for this signature in database
1 changed files with 12 additions and 2 deletions

View File

@ -29,8 +29,18 @@ export const createActions = context => {
}) })
} }
const getRow = () => { const getRow = async id => {
throw "Views don't support fetching individual rows" const res = await API.viewV2.fetch({
viewId: get(datasource).id,
limit: 1,
query: {
equal: {
_id: id,
},
},
paginate: false,
})
return res?.rows?.[0]
} }
const isDatasourceValid = datasource => { const isDatasourceValid = datasource => {