forked from directus/directus
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
92246d5
commit 8519fad
Showing
6 changed files
with
90 additions
and
57 deletions.
There are no files selected for viewing
File renamed without changes.
File renamed without changes.
File renamed without changes.
25 changes: 25 additions & 0 deletions
25
api/extensions/directus-extension-create-user/src/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
|
||
export default ({ filter }, context) => { | ||
const { services, getSchema } = context; // getSchema is a function that returns the schema of the current collection | ||
const { ItemsService, UsersService, RolesService, PermissionsService } = services; // get the services we need | ||
|
||
const functionName = async (input, meta, context) => { | ||
console.log('Creating Student Item!'); | ||
|
||
input.number = 1706; | ||
|
||
// const schema = await getSchema(); // 会报错 | ||
// const { accountability } = context; | ||
// const itemsService = new ItemsService('students', { schema }); | ||
|
||
// const data = await itemsService.createOne({ | ||
// number: 22, | ||
// email: 'hello@world.com', | ||
// name: 'This is our first article', | ||
// }); | ||
|
||
return input; | ||
}; | ||
|
||
filter('students.items.create', functionName); | ||
}; |
57 changes: 0 additions & 57 deletions
57
api/extensions/【弃用】directus-extension-create-user/src/index.js
This file was deleted.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.