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:
Jayden Seric 2018-09-18 22:08:10 +10:00
parent af6c8d9b84
commit 4d258cf0d5
7 changed files with 3 additions and 10 deletions

View File

@ -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 {

View File

@ -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 {

View File

@ -67,7 +67,6 @@ export default graphql(gql`
singleUpload(file: $file) { singleUpload(file: $file) {
id id
filename filename
encoding
mimetype mimetype
path path
} }

View File

@ -32,7 +32,6 @@ export default graphql(gql`
singleUpload(file: $file) { singleUpload(file: $file) {
id id
filename filename
encoding
mimetype mimetype
path path
} }

View File

@ -27,7 +27,6 @@ export default graphql(gql`
multipleUpload(files: $files) { multipleUpload(files: $files) {
id id
filename filename
encoding
mimetype mimetype
path path
} }

View File

@ -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>
))} ))}

View File

@ -5,7 +5,6 @@ export default gql`
uploads { uploads {
id id
filename filename
encoding
mimetype mimetype
path path
} }