Fix error occurring when attaching a file to a Task
Extend the SQL storing the information to a file by username and creation date.
This commit is contained in:
parent
9b615f894c
commit
632e811b75
|
@ -12,7 +12,11 @@ import (
|
||||||
// AddFile is used to add the md5 of a file name which is uploaded to our application
|
// AddFile is used to add the md5 of a file name which is uploaded to our application
|
||||||
// this will enable us to randomize the URL without worrying about the file names
|
// this will enable us to randomize the URL without worrying about the file names
|
||||||
func AddFile(fileName, token, username string) error {
|
func AddFile(fileName, token, username string) error {
|
||||||
err := taskQuery("insert into files values(?,?,?,datetime())", fileName, token, username)
|
userID, err := GetUserID(username)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
err = taskQuery("insert into files values(?,?,?,datetime())", fileName, token, userID)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue