feat: allows upload through Local API

This commit is contained in:
James
2021-02-05 16:09:53 -05:00
parent fd01715b5b
commit 1a590287ea
13 changed files with 129 additions and 13 deletions

View File

@@ -96,6 +96,11 @@ const post = await payload.create({
// If creating verification-enabled auth doc,
// you can optionally disable the email that is auto-sent
disableVerificationEmail: true,
// If your collection supports uploads, you can upload
// a file directly through the Local API by providing
// its full, absolute file path.
filePath: path.resolve(__dirname, './path-to-image.jpg'),
})
```
@@ -152,6 +157,11 @@ const result = await payload.update({
user: dummyUser,
overrideAccess: false,
showHiddenFields: true,
// If your collection supports uploads, you can upload
// a file directly through the Local API by providing
// its full, absolute file path.
filePath: path.resolve(__dirname, './path-to-image.jpg'),
})
```