Skip to content

Commit

Permalink
Fix cannot upload first file (#56)
Browse files Browse the repository at this point in the history
* [fix] - 初めてのアップロード時の容量計算ならテーブルを作って0を返す

* [fix] - if not existsのSQL文は成功パターンを全部返すらしい

* [change] - チャンネル用フォルダのRegex変更

* [change] - ファイルの公開設定切り替え時ファイルIdを送るように
  • Loading branch information
NfoAlex authored Jul 29, 2024
1 parent 8d9d35a commit 06666a9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/fileHandler/File/uploadfile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ export default async function uploadfile(req:any, res:any) {
//チャンネルフォルダを作成するかどうかフラグ
let flagCreateChannelFolder:boolean = false;
//もしディレクトリIdがチャンネルフォルダに該当するならディレクトリが作成されているかを確認
const regexChannelId = /^C\d{4}$/;
//const regexChannelId = /^C\d{4}$/;
const regexChannelId = /^C\d{4}_\d+$/;
if (metadata.directory.match(regexChannelId) !== null) {
//このチャンネル用のフォルダを取得
const directoryForChannel = await fetchFolderInfo(metadata.RequestSender.userId, metadata.directory);
Expand Down
2 changes: 1 addition & 1 deletion src/socketHandler/File.ts
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ module.exports = (io:Server) => {
if (resultToggle) {
socket.emit("RESULT::toggleFileIsPublic", {
result: "SUCCESS",
data: null
data: dat.fileId
});
} else {
socket.emit("RESULT::toggleFileIsPublic", {
Expand Down

0 comments on commit 06666a9

Please sign in to comment.