Removed encoding from the File type.
It was missleading, as the encoding was only for the upload stream, not the file contents when stored.
This commit is contained in:
parent
af6c8d9b84
commit
4d258cf0d5
@ -39,9 +39,9 @@ const storeDB = file =>
|
|||||||
.write()
|
.write()
|
||||||
|
|
||||||
const processUpload = async upload => {
|
const processUpload = async upload => {
|
||||||
const { stream, filename, mimetype, encoding } = await upload
|
const { stream, filename, mimetype } = await upload
|
||||||
const { id, path } = await storeFS({ stream, filename })
|
const { id, path } = await storeFS({ stream, filename })
|
||||||
return storeDB({ id, filename, mimetype, encoding, path })
|
return storeDB({ id, filename, mimetype, path })
|
||||||
}
|
}
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
|||||||
@ -4,7 +4,6 @@ export default /* GraphQL */ `
|
|||||||
path: String!
|
path: String!
|
||||||
filename: String!
|
filename: String!
|
||||||
mimetype: String!
|
mimetype: String!
|
||||||
encoding: String!
|
|
||||||
}
|
}
|
||||||
|
|
||||||
type Query {
|
type Query {
|
||||||
|
|||||||
@ -67,7 +67,6 @@ export default graphql(gql`
|
|||||||
singleUpload(file: $file) {
|
singleUpload(file: $file) {
|
||||||
id
|
id
|
||||||
filename
|
filename
|
||||||
encoding
|
|
||||||
mimetype
|
mimetype
|
||||||
path
|
path
|
||||||
}
|
}
|
||||||
|
|||||||
@ -32,7 +32,6 @@ export default graphql(gql`
|
|||||||
singleUpload(file: $file) {
|
singleUpload(file: $file) {
|
||||||
id
|
id
|
||||||
filename
|
filename
|
||||||
encoding
|
|
||||||
mimetype
|
mimetype
|
||||||
path
|
path
|
||||||
}
|
}
|
||||||
|
|||||||
@ -27,7 +27,6 @@ export default graphql(gql`
|
|||||||
multipleUpload(files: $files) {
|
multipleUpload(files: $files) {
|
||||||
id
|
id
|
||||||
filename
|
filename
|
||||||
encoding
|
|
||||||
mimetype
|
mimetype
|
||||||
path
|
path
|
||||||
}
|
}
|
||||||
|
|||||||
@ -8,15 +8,13 @@ const Uploads = ({ data: { uploads = [] } }) => (
|
|||||||
<tr>
|
<tr>
|
||||||
<Head>Filename</Head>
|
<Head>Filename</Head>
|
||||||
<Head>MIME type</Head>
|
<Head>MIME type</Head>
|
||||||
<Head>Encoding</Head>
|
|
||||||
<Head>Path</Head>
|
<Head>Path</Head>
|
||||||
</tr>
|
</tr>
|
||||||
}
|
}
|
||||||
tbody={uploads.map(({ id, filename, mimetype, encoding, path }) => (
|
tbody={uploads.map(({ id, filename, mimetype, path }) => (
|
||||||
<tr key={id}>
|
<tr key={id}>
|
||||||
<Cell>{filename}</Cell>
|
<Cell>{filename}</Cell>
|
||||||
<Cell>{mimetype}</Cell>
|
<Cell>{mimetype}</Cell>
|
||||||
<Cell>{encoding}</Cell>
|
|
||||||
<Cell>{path}</Cell>
|
<Cell>{path}</Cell>
|
||||||
</tr>
|
</tr>
|
||||||
))}
|
))}
|
||||||
|
|||||||
@ -5,7 +5,6 @@ export default gql`
|
|||||||
uploads {
|
uploads {
|
||||||
id
|
id
|
||||||
filename
|
filename
|
||||||
encoding
|
|
||||||
mimetype
|
mimetype
|
||||||
path
|
path
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user