- Introduced new page component for library topics with type checks. - Added migration scripts to update access rules for various collections including badges, curriculum versions, and themes. - Implemented PocketBase integration for managing collection access rules dynamically. - Ensured proper type validation for page props and metadata generation functions.
25 lines
785 B
JavaScript
25 lines
785 B
JavaScript
/// <reference path="../pb_data/types.d.ts" />
|
|
migrate((db) => {
|
|
const dao = new Dao(db)
|
|
const collection = dao.findCollectionByNameOrId("ilkfmv9xibmekna")
|
|
|
|
collection.listRule = "@request.auth.id != \"\""
|
|
collection.viewRule = "@request.auth.id != \"\""
|
|
collection.createRule = "@request.auth.role = \"admin\""
|
|
collection.updateRule = "@request.auth.role = \"admin\""
|
|
collection.deleteRule = "@request.auth.role = \"admin\""
|
|
|
|
return dao.saveCollection(collection)
|
|
}, (db) => {
|
|
const dao = new Dao(db)
|
|
const collection = dao.findCollectionByNameOrId("ilkfmv9xibmekna")
|
|
|
|
collection.listRule = null
|
|
collection.viewRule = null
|
|
collection.createRule = null
|
|
collection.updateRule = null
|
|
collection.deleteRule = null
|
|
|
|
return dao.saveCollection(collection)
|
|
})
|