Skip to content

Commit

Permalink
update(reviewed): fix minor possible issues thanks to the reviews pro…
Browse files Browse the repository at this point in the history
…vided
  • Loading branch information
dependentmadani committed Jul 5, 2024
1 parent c8c21c3 commit a5f7ad1
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 20 deletions.
5 changes: 1 addition & 4 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
{
"globals": {
"HTMLOListElement": true,
"HTMLUListElement": true
},
"globals": {},
"parserOptions": {
"sourceType": "module",
"ecmaVersion": 2020
Expand Down
13 changes: 0 additions & 13 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,6 @@ on:
- master

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 19
registry-url: https://registry.npmjs.org/
- run: yarn install
- run: yarn build
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

publish-and-notify:
uses: codex-team/github-workflows/.github/workflows/npm-publish-and-notify-reusable.yml@main
secrets:
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
"exports": {
".": {
"import": "./dist/image.mjs",
"require": "./dist/image.umd.js"
"require": "./dist/image.umd.js",
"types": "./dist/index.d.ts"
}
},
"scripts": {
Expand Down
4 changes: 2 additions & 2 deletions src/uploader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export default class Uploader {
// custom uploading
if (this.config.uploader && typeof this.config.uploader.uploadByFile === 'function') {
const uploadByFile = this.config.uploader.uploadByFile;
upload = ajax.selectFiles({ accept: this.config.types || ''}).then((files: File[]) => {
upload = ajax.selectFiles({ accept: this.config.types || 'image/*'}).then((files: File[]) => {
preparePreview(files[0]);

const customUpload = uploadByFile(files[0]);
Expand Down Expand Up @@ -181,7 +181,7 @@ export default class Uploader {
*/
const formData = new FormData();

formData.append(this.config.field || '', file);
formData.append(this.config.field || 'image', file);

if (this.config.additionalRequestData && Object.keys(this.config.additionalRequestData).length) {
Object.entries(this.config.additionalRequestData).forEach(([name, value]: [string, any]) => {
Expand Down

0 comments on commit a5f7ad1

Please sign in to comment.