diff --git a/app/config/config.yaml b/app/config/config.yaml
index c4b99b0..cf51ace 100644
--- a/app/config/config.yaml
+++ b/app/config/config.yaml
@@ -1,7 +1,7 @@
# All values in this config file WILL BE overwritten by ENV variables (GI_SERVER_PORT for example) if they exist.
Server:
port: 3500
- locationPhotoDir: "./app/photos/locations/"
+ locationFilesDir: "./app/files/locations/"
Logger:
loglevel: "debug" # debug/info/warn/error
diff --git a/app/files/locations/Final Test/Final Test_cover.png b/app/files/locations/Final Test/Final Test_cover.png
new file mode 100644
index 0000000..f2c863e
Binary files /dev/null and b/app/files/locations/Final Test/Final Test_cover.png differ
diff --git a/app/photos/locations/Location1/Kitchen/Kitchen_0.png b/app/files/locations/Location1/Kitchen/Kitchen_0.png
similarity index 100%
rename from app/photos/locations/Location1/Kitchen/Kitchen_0.png
rename to app/files/locations/Location1/Kitchen/Kitchen_0.png
diff --git a/app/photos/locations/Location1/Kitchen/Kitchen_cover.png b/app/files/locations/Location1/Kitchen/Kitchen_cover.png
similarity index 100%
rename from app/photos/locations/Location1/Kitchen/Kitchen_cover.png
rename to app/files/locations/Location1/Kitchen/Kitchen_cover.png
diff --git a/app/photos/locations/Location1/Location1_0.png b/app/files/locations/Location1/Location1_0.png
similarity index 100%
rename from app/photos/locations/Location1/Location1_0.png
rename to app/files/locations/Location1/Location1_0.png
diff --git a/app/photos/locations/Location1/Location1_1.png b/app/files/locations/Location1/Location1_1.png
similarity index 100%
rename from app/photos/locations/Location1/Location1_1.png
rename to app/files/locations/Location1/Location1_1.png
diff --git a/app/photos/locations/Location1/Location1_cover.png b/app/files/locations/Location1/Location1_cover.png
similarity index 100%
rename from app/photos/locations/Location1/Location1_cover.png
rename to app/files/locations/Location1/Location1_cover.png
diff --git a/app/photos/locations/Location10/Location10_cover.png b/app/files/locations/Location10/Location10_cover.png
similarity index 100%
rename from app/photos/locations/Location10/Location10_cover.png
rename to app/files/locations/Location10/Location10_cover.png
diff --git a/app/photos/locations/Location4/Kitchen/Kitchen_0.png b/app/files/locations/Location4/Kitchen/Kitchen_0.png
similarity index 100%
rename from app/photos/locations/Location4/Kitchen/Kitchen_0.png
rename to app/files/locations/Location4/Kitchen/Kitchen_0.png
diff --git a/app/photos/locations/Location4/Kitchen/Kitchen_cover.png b/app/files/locations/Location4/Kitchen/Kitchen_cover.png
similarity index 100%
rename from app/photos/locations/Location4/Kitchen/Kitchen_cover.png
rename to app/files/locations/Location4/Kitchen/Kitchen_cover.png
diff --git a/app/photos/locations/Location4/Location4_0.png b/app/files/locations/Location4/Location4_0.png
similarity index 100%
rename from app/photos/locations/Location4/Location4_0.png
rename to app/files/locations/Location4/Location4_0.png
diff --git a/app/photos/locations/Location4/Location4_1.png b/app/files/locations/Location4/Location4_1.png
similarity index 100%
rename from app/photos/locations/Location4/Location4_1.png
rename to app/files/locations/Location4/Location4_1.png
diff --git a/app/photos/locations/Location4/Location4_cover.png b/app/files/locations/Location4/Location4_cover.png
similarity index 100%
rename from app/photos/locations/Location4/Location4_cover.png
rename to app/files/locations/Location4/Location4_cover.png
diff --git a/app/photos/locations/Location6/Location6_0.png b/app/files/locations/Location6/Location6_0.png
similarity index 100%
rename from app/photos/locations/Location6/Location6_0.png
rename to app/files/locations/Location6/Location6_0.png
diff --git a/app/photos/locations/Location6/Location6_1.png b/app/files/locations/Location6/Location6_1.png
similarity index 100%
rename from app/photos/locations/Location6/Location6_1.png
rename to app/files/locations/Location6/Location6_1.png
diff --git a/app/photos/locations/Location6/Location6_cover.png b/app/files/locations/Location6/Location6_cover.png
similarity index 100%
rename from app/photos/locations/Location6/Location6_cover.png
rename to app/files/locations/Location6/Location6_cover.png
diff --git a/app/files/locations/TESTasdfsdaf/TESTasdfsdaf_cover.png b/app/files/locations/TESTasdfsdaf/TESTasdfsdaf_cover.png
new file mode 100644
index 0000000..dc581ea
Binary files /dev/null and b/app/files/locations/TESTasdfsdaf/TESTasdfsdaf_cover.png differ
diff --git a/app/log/goInventorize.log b/app/log/goInventorize.log
index b7bb475..4f7a7f6 100644
--- a/app/log/goInventorize.log
+++ b/app/log/goInventorize.log
@@ -5,10 +5,10 @@
{"level":"error","time":"2022-04-02T22:20:17-04:00","message":"SearchAllByField failed to return results: not found "}
{"logtype":"webserver", "pid":"19312", "requestid":"", "status":"200", "method":"GET", "path":"/api/search/all"}
{"level":"info","time":"2022-04-02T22:21:18-04:00","message":"Configuration loaded successfully..."}
-{"level":"debug","time":"2022-04-02T22:21:18-04:00","message":"{Timezone:America/New_York Server:{Port:3500 LocationPhotoDir:./app/photos/locations/} Logger:{Level:debug LoggingFile:./app/log/goInventorize.log} Authentication:{BasicAuth:false UserName:admin Password:password} Development:false}"}
+{"level":"debug","time":"2022-04-02T22:21:18-04:00","message":"{Timezone:America/New_York Server:{Port:3500 LocationFilesDir:./app/photos/locations/} Logger:{Level:debug LoggingFile:./app/log/goInventorize.log} Authentication:{BasicAuth:false UserName:admin Password:password} Development:false}"}
{"level":"info","time":"2022-04-02T22:21:18-04:00","message":"Database and Config loaded, starting webserver..."}
{"level":"info","time":"2022-04-02T22:22:54-04:00","message":"Configuration loaded successfully..."}
-{"level":"debug","time":"2022-04-02T22:22:54-04:00","message":"{Timezone:America/New_York Server:{Port:3500 LocationPhotoDir:./app/photos/locations/} Logger:{Level:debug LoggingFile:./app/log/goInventorize.log} Authentication:{BasicAuth:false UserName:admin Password:password} Development:false}"}
+{"level":"debug","time":"2022-04-02T22:22:54-04:00","message":"{Timezone:America/New_York Server:{Port:3500 LocationFilesDir:./app/photos/locations/} Logger:{Level:debug LoggingFile:./app/log/goInventorize.log} Authentication:{BasicAuth:false UserName:admin Password:password} Development:false}"}
{"level":"info","time":"2022-04-02T22:22:54-04:00","message":"Database and Config loaded, starting webserver..."}
{"level":"debug","time":"2022-04-02T22:23:04-04:00","message":"Seach by term: Location in all items at field: Name"}
{"level":"info","time":"2022-04-02T22:23:04-04:00","message":"Searching all items for term: Location"}
@@ -17,25 +17,25 @@
{"level":"info","time":"2022-04-02T22:23:09-04:00","message":"Searching all items for term: Location4"}
{"logtype":"webserver", "pid":"7620", "requestid":"", "status":"200", "method":"GET", "path":"/api/search/all"}
{"level":"info","time":"2022-04-02T22:29:23-04:00","message":"Configuration loaded successfully..."}
-{"level":"debug","time":"2022-04-02T22:29:23-04:00","message":"{Timezone:America/New_York Server:{Port:3500 LocationPhotoDir:./app/photos/locations/} Logger:{Level:debug LoggingFile:./app/log/goInventorize.log} Authentication:{BasicAuth:false UserName:admin Password:password} Development:false}"}
+{"level":"debug","time":"2022-04-02T22:29:23-04:00","message":"{Timezone:America/New_York Server:{Port:3500 LocationFilesDir:./app/photos/locations/} Logger:{Level:debug LoggingFile:./app/log/goInventorize.log} Authentication:{BasicAuth:false UserName:admin Password:password} Development:false}"}
{"level":"info","time":"2022-04-02T22:29:23-04:00","message":"Database and Config loaded, starting webserver..."}
{"level":"info","time":"2022-04-02T22:29:31-04:00","message":"Configuration loaded successfully..."}
-{"level":"debug","time":"2022-04-02T22:29:31-04:00","message":"{Timezone:America/New_York Server:{Port:3500 LocationPhotoDir:./app/photos/locations/} Logger:{Level:debug LoggingFile:./app/log/goInventorize.log} Authentication:{BasicAuth:false UserName:admin Password:password} Development:false}"}
+{"level":"debug","time":"2022-04-02T22:29:31-04:00","message":"{Timezone:America/New_York Server:{Port:3500 LocationFilesDir:./app/photos/locations/} Logger:{Level:debug LoggingFile:./app/log/goInventorize.log} Authentication:{BasicAuth:false UserName:admin Password:password} Development:false}"}
{"level":"info","time":"2022-04-02T22:29:31-04:00","message":"Database and Config loaded, starting webserver..."}
{"level":"debug","time":"2022-04-02T22:29:37-04:00","message":"Seach by term: Location4 in all items at field: Name"}
{"level":"info","time":"2022-04-02T22:29:37-04:00","message":"Searching all items for term: Location4"}
{"logtype":"webserver", "pid":"15332", "requestid":"", "status":"200", "method":"GET", "path":"/api/search/all"}
{"level":"info","time":"2022-04-02T22:30:28-04:00","message":"Configuration loaded successfully..."}
-{"level":"debug","time":"2022-04-02T22:30:28-04:00","message":"{Timezone:America/New_York Server:{Port:3500 LocationPhotoDir:./app/photos/locations/} Logger:{Level:debug LoggingFile:./app/log/goInventorize.log} Authentication:{BasicAuth:false UserName:admin Password:password} Development:false}"}
+{"level":"debug","time":"2022-04-02T22:30:28-04:00","message":"{Timezone:America/New_York Server:{Port:3500 LocationFilesDir:./app/photos/locations/} Logger:{Level:debug LoggingFile:./app/log/goInventorize.log} Authentication:{BasicAuth:false UserName:admin Password:password} Development:false}"}
{"level":"info","time":"2022-04-02T22:30:28-04:00","message":"Database and Config loaded, starting webserver..."}
{"level":"info","time":"2022-04-02T22:30:34-04:00","message":"Configuration loaded successfully..."}
-{"level":"debug","time":"2022-04-02T22:30:34-04:00","message":"{Timezone:America/New_York Server:{Port:3500 LocationPhotoDir:./app/photos/locations/} Logger:{Level:debug LoggingFile:./app/log/goInventorize.log} Authentication:{BasicAuth:false UserName:admin Password:password} Development:false}"}
+{"level":"debug","time":"2022-04-02T22:30:34-04:00","message":"{Timezone:America/New_York Server:{Port:3500 LocationFilesDir:./app/photos/locations/} Logger:{Level:debug LoggingFile:./app/log/goInventorize.log} Authentication:{BasicAuth:false UserName:admin Password:password} Development:false}"}
{"level":"info","time":"2022-04-02T22:30:34-04:00","message":"Database and Config loaded, starting webserver..."}
{"level":"debug","time":"2022-04-02T22:30:36-04:00","message":"Seach by term: Location4 in all items at field: Name"}
{"level":"info","time":"2022-04-02T22:30:36-04:00","message":"Searching all items for term: Location4"}
{"logtype":"webserver", "pid":"30864", "requestid":"", "status":"200", "method":"GET", "path":"/api/search/all"}
{"level":"info","time":"2022-04-02T22:31:16-04:00","message":"Configuration loaded successfully..."}
-{"level":"debug","time":"2022-04-02T22:31:16-04:00","message":"{Timezone:America/New_York Server:{Port:3500 LocationPhotoDir:./app/photos/locations/} Logger:{Level:debug LoggingFile:./app/log/goInventorize.log} Authentication:{BasicAuth:false UserName:admin Password:password} Development:false}"}
+{"level":"debug","time":"2022-04-02T22:31:16-04:00","message":"{Timezone:America/New_York Server:{Port:3500 LocationFilesDir:./app/photos/locations/} Logger:{Level:debug LoggingFile:./app/log/goInventorize.log} Authentication:{BasicAuth:false UserName:admin Password:password} Development:false}"}
{"level":"info","time":"2022-04-02T22:31:16-04:00","message":"Database and Config loaded, starting webserver..."}
{"level":"debug","time":"2022-04-02T22:31:22-04:00","message":"Seach by term: Location4 in all items at field: Name"}
{"level":"info","time":"2022-04-02T22:31:22-04:00","message":"Searching all items for term: Location4"}
@@ -44,10 +44,10 @@
{"level":"info","time":"2022-04-02T22:32:41-04:00","message":"Searching all items for term: Kitchen"}
{"logtype":"webserver", "pid":"8468", "requestid":"", "status":"200", "method":"GET", "path":"/api/search/all"}
{"level":"info","time":"2022-04-02T22:33:39-04:00","message":"Configuration loaded successfully..."}
-{"level":"debug","time":"2022-04-02T22:33:39-04:00","message":"{Timezone:America/New_York Server:{Port:3500 LocationPhotoDir:./app/photos/locations/} Logger:{Level:debug LoggingFile:./app/log/goInventorize.log} Authentication:{BasicAuth:false UserName:admin Password:password} Development:false}"}
+{"level":"debug","time":"2022-04-02T22:33:39-04:00","message":"{Timezone:America/New_York Server:{Port:3500 LocationFilesDir:./app/photos/locations/} Logger:{Level:debug LoggingFile:./app/log/goInventorize.log} Authentication:{BasicAuth:false UserName:admin Password:password} Development:false}"}
{"level":"info","time":"2022-04-02T22:33:39-04:00","message":"Database and Config loaded, starting webserver..."}
{"level":"info","time":"2022-04-02T22:38:47-04:00","message":"Configuration loaded successfully..."}
-{"level":"debug","time":"2022-04-02T22:38:47-04:00","message":"{Timezone:America/New_York Server:{Port:3500 LocationPhotoDir:./app/photos/locations/} Logger:{Level:debug LoggingFile:./app/log/goInventorize.log} Authentication:{BasicAuth:false UserName:admin Password:password} Development:false}"}
+{"level":"debug","time":"2022-04-02T22:38:47-04:00","message":"{Timezone:America/New_York Server:{Port:3500 LocationFilesDir:./app/photos/locations/} Logger:{Level:debug LoggingFile:./app/log/goInventorize.log} Authentication:{BasicAuth:false UserName:admin Password:password} Development:false}"}
{"level":"info","time":"2022-04-02T22:38:47-04:00","message":"Database and Config loaded, starting webserver..."}
{"level":"info","time":"2022-04-02T22:39:03-04:00","message":"Fetching room with id: 1"}
{"logtype":"webserver", "pid":"11448", "requestid":"", "status":"200", "method":"GET", "path":"/api/rooms/1"}
@@ -79,7 +79,7 @@
{"level":"debug","time":"2022-04-02T23:14:39-04:00","message":"Returning Locations: [{ID:1 Name:Location4 Description: CoverPhoto:Location4_cover.png Photos:[Location4_0.png Location4_1.png] Rooms:[{ID:0 Name:Kitchen Description: CoverPhoto:Location4/Kitchen/Kitchen_cover.png Photos:[Location4/Kitchen/Kitchen_0.png] Paint: Notes:Notes For My Room! Cabinets:[] Items:[] SquareFeet:0 LocationID:1 LocationName:Location4}] Notes:Notes for my location! Address: SquareFeet:0 Latitude: Longitude: DatePurchased: PurchasePrice: CurrentValue:} {ID:2 Name:Location6 Description: CoverPhoto:Location6_cover.png Photos:[Location6_0.png Location6_1.png] Rooms:[] Notes:Notes for my location!6 Address: SquareFeet:0 Latitude: Longitude: DatePurchased: PurchasePrice: CurrentValue:} {ID:3 Name:Location10 Description: CoverPhoto:Location10_cover.png Photos:[] Rooms:[] Notes:Notes for my location!10 Address: SquareFeet:0 Latitude: Longitude: DatePurchased: PurchasePrice: CurrentValue:}]"}
{"logtype":"webserver", "pid":"11448", "requestid":"", "status":"200", "method":"GET", "path":"/api/locations"}
{"level":"info","time":"2022-04-03T16:13:11-04:00","message":"Configuration loaded successfully..."}
-{"level":"debug","time":"2022-04-03T16:13:11-04:00","message":"{Timezone:America/New_York Server:{Port:3500 LocationPhotoDir:./app/photos/locations/} Logger:{Level:debug LoggingFile:./app/log/goInventorize.log} Authentication:{BasicAuth:false UserName:admin Password:password} Development:false}"}
+{"level":"debug","time":"2022-04-03T16:13:11-04:00","message":"{Timezone:America/New_York Server:{Port:3500 LocationFilesDir:./app/photos/locations/} Logger:{Level:debug LoggingFile:./app/log/goInventorize.log} Authentication:{BasicAuth:false UserName:admin Password:password} Development:false}"}
{"level":"info","time":"2022-04-03T16:13:11-04:00","message":"Database and Config loaded, starting webserver..."}
{"logtype":"webserver", "pid":"8168", "requestid":"", "status":"200", "method":"GET", "path":"/api/config"}
{"logtype":"webserver", "pid":"8168", "requestid":"", "status":"200", "method":"GET", "path":"/api/config"}
@@ -96,19 +96,72 @@
{"logtype":"webserver", "pid":"8168", "requestid":"", "status":"200", "method":"GET", "path":"/api/locations"}
{"logtype":"webserver", "pid":"8168", "requestid":"", "status":"200", "method":"GET", "path":"/api/config"}
{"level":"info","time":"2022-04-03T20:46:19-04:00","message":"Configuration loaded successfully..."}
-{"level":"debug","time":"2022-04-03T20:46:19-04:00","message":"{Timezone:America/New_York Server:{Port:3500 LocationPhotoDir:./app/photos/locations/} Logger:{Level:debug LoggingFile:./app/log/goInventorize.log} Authentication:{BasicAuth:false UserName:admin Password:password} Development:false}"}
+{"level":"debug","time":"2022-04-03T20:46:19-04:00","message":"{Timezone:America/New_York Server:{Port:3500 LocationFilesDir:./app/photos/locations/} Logger:{Level:debug LoggingFile:./app/log/goInventorize.log} Authentication:{BasicAuth:false UserName:admin Password:password} Development:false}"}
{"level":"info","time":"2022-04-03T20:46:19-04:00","message":"Database and Config loaded, starting webserver..."}
{"level":"info","time":"2022-04-03T20:46:20-04:00","message":"Configuration loaded successfully..."}
-{"level":"debug","time":"2022-04-03T20:46:20-04:00","message":"{Timezone:America/New_York Server:{Port:3500 LocationPhotoDir:./app/photos/locations/} Logger:{Level:debug LoggingFile:./app/log/goInventorize.log} Authentication:{BasicAuth:false UserName:admin Password:password} Development:false}"}
+{"level":"debug","time":"2022-04-03T20:46:20-04:00","message":"{Timezone:America/New_York Server:{Port:3500 LocationFilesDir:./app/photos/locations/} Logger:{Level:debug LoggingFile:./app/log/goInventorize.log} Authentication:{BasicAuth:false UserName:admin Password:password} Development:false}"}
{"level":"info","time":"2022-04-03T20:46:20-04:00","message":"Database and Config loaded, starting webserver..."}
{"logtype":"webserver", "pid":"16808", "requestid":"", "status":"200", "method":"GET", "path":"/api/config"}
{"level":"info","time":"2022-04-03T20:52:11-04:00","message":"Configuration loaded successfully..."}
-{"level":"debug","time":"2022-04-03T20:52:11-04:00","message":"{Timezone:America/New_York Server:{Port:3500 LocationPhotoDir:./app/photos/locations/} Logger:{Level:debug LoggingFile:./app/log/goInventorize.log} Authentication:{BasicAuth:false UserName:admin Password:password} Development:false}"}
+{"level":"debug","time":"2022-04-03T20:52:11-04:00","message":"{Timezone:America/New_York Server:{Port:3500 LocationFilesDir:./app/photos/locations/} Logger:{Level:debug LoggingFile:./app/log/goInventorize.log} Authentication:{BasicAuth:false UserName:admin Password:password} Development:false}"}
{"level":"info","time":"2022-04-03T20:52:11-04:00","message":"Database and Config loaded, starting webserver..."}
{"logtype":"webserver", "pid":"19608", "requestid":"", "status":"200", "method":"GET", "path":"/api/config"}
{"logtype":"webserver", "pid":"19608", "requestid":"", "status":"200", "method":"GET", "path":"/api/config"}
{"level":"info","time":"2022-04-03T21:44:35-04:00","message":"Configuration loaded successfully..."}
-{"level":"debug","time":"2022-04-03T21:44:35-04:00","message":"{Timezone:America/New_York Server:{Port:3500 LocationPhotoDir:./app/photos/locations/} Logger:{Level:debug LoggingFile:./app/log/goInventorize.log} Authentication:{BasicAuth:false UserName:admin Password:password} Development:false}"}
+{"level":"debug","time":"2022-04-03T21:44:35-04:00","message":"{Timezone:America/New_York Server:{Port:3500 LocationFilesDir:./app/photos/locations/} Logger:{Level:debug LoggingFile:./app/log/goInventorize.log} Authentication:{BasicAuth:false UserName:admin Password:password} Development:false}"}
{"level":"info","time":"2022-04-03T21:44:35-04:00","message":"Database and Config loaded, starting webserver..."}
{"logtype":"webserver", "pid":"1812", "requestid":"", "status":"200", "method":"GET", "path":"/api/config"}
{"logtype":"webserver", "pid":"1812", "requestid":"", "status":"200", "method":"GET", "path":"/api/config"}
+{"level":"info","time":"2022-04-07T16:25:58-04:00","message":"Configuration loaded successfully..."}
+{"level":"debug","time":"2022-04-07T16:25:58-04:00","message":"{Timezone:America/New_York Server:{Port:3500 LocationFilesDir:./app/photos/locations/} Logger:{Level:debug LoggingFile:./app/log/goInventorize.log} Authentication:{BasicAuth:false UserName:admin Password:password} Development:false}"}
+{"level":"info","time":"2022-04-07T16:25:58-04:00","message":"Database and Config loaded, starting webserver..."}
+{"logtype":"webserver", "pid":"23364", "requestid":"", "status":"200", "method":"GET", "path":"/api/config"}
+{"logtype":"webserver", "pid":"23364", "requestid":"", "status":"200", "method":"GET", "path":"/api/config"}
+{"level":"info","time":"2022-04-08T21:57:11-04:00","message":"Configuration loaded successfully..."}
+{"level":"debug","time":"2022-04-08T21:57:11-04:00","message":"{Timezone:America/New_York Server:{Port:3500 LocationFilesDir:./app/photos/locations/} Logger:{Level:debug LoggingFile:./app/log/goInventorize.log} Authentication:{BasicAuth:false UserName:admin Password:password} Development:false}"}
+{"level":"info","time":"2022-04-08T21:57:11-04:00","message":"Database and Config loaded, starting webserver..."}
+{"level":"info","time":"2022-04-08T22:10:01-04:00","message":"Configuration loaded successfully..."}
+{"level":"debug","time":"2022-04-08T22:10:01-04:00","message":"{Timezone:America/New_York Server:{Port:3500 LocationFilesDir:./app/photos/locations/} Logger:{Level:debug LoggingFile:./app/log/goInventorize.log} Authentication:{BasicAuth:false UserName:admin Password:password} Development:false}"}
+{"level":"info","time":"2022-04-08T22:10:01-04:00","message":"Database and Config loaded, starting webserver..."}
+{"level":"info","time":"2022-04-08T22:19:45-04:00","message":"Configuration loaded successfully..."}
+{"level":"debug","time":"2022-04-08T22:19:45-04:00","message":"{Timezone:America/New_York Server:{Port:3500 LocationFilesDir:./app/photos/locations/} Logger:{Level:debug LoggingFile:./app/log/goInventorize.log} Authentication:{BasicAuth:false UserName:admin Password:password} Development:false}"}
+{"level":"info","time":"2022-04-08T22:19:45-04:00","message":"Database and Config loaded, starting webserver..."}
+{"level":"info","time":"2022-04-08T22:22:18-04:00","message":"Configuration loaded successfully..."}
+{"level":"debug","time":"2022-04-08T22:22:18-04:00","message":"{Timezone:America/New_York Server:{Port:3500 LocationFilesDir:./app/photos/locations/} Logger:{Level:debug LoggingFile:./app/log/goInventorize.log} Authentication:{BasicAuth:false UserName:admin Password:password} Development:false}"}
+{"level":"info","time":"2022-04-08T22:22:18-04:00","message":"Database and Config loaded, starting webserver..."}
+{"level":"info","time":"2022-04-08T22:22:24-04:00","message":"Adding new location to database: %!(EXTRA main.Location={0 TESTasdfsdaf test 0 TESTasdfsdaf_cover.png [] [] []})"}
+{"level":"debug","time":"2022-04-08T22:22:24-04:00","message":"Adding new location: {0 TESTasdfsdaf test 0 TESTasdfsdaf_cover.png [] [] []}"}
+{"logtype":"webserver", "pid":"11084", "requestid":"", "status":"200", "method":"POST", "path":"/api/locations/new"}
+{"level":"debug","time":"2022-04-08T22:22:34-04:00","message":"Returning Locations: [{ID:1 Name:Location4 Description: Notes:Notes for my location! Address: SquareFeet:0 Latitude: Longitude: DatePurchased: PurchasePrice: CurrentValue: CoverPhoto:Location4_cover.png Photos:[Location4_0.png Location4_1.png] Files:[] Rooms:[{ID:0 Name:Kitchen Description: Paint: Notes:Notes For My Room! SquareFeet:0 CoverPhoto:Location4/Kitchen/Kitchen_cover.png Photos:[Location4/Kitchen/Kitchen_0.png] Cabinets:[] Items:[] LocationID:1 LocationName:Location4}]} {ID:2 Name:Location6 Description: Notes:Notes for my location!6 Address: SquareFeet:0 Latitude: Longitude: DatePurchased: PurchasePrice: CurrentValue: CoverPhoto:Location6_cover.png Photos:[Location6_0.png Location6_1.png] Files:[] Rooms:[]} {ID:3 Name:Location10 Description: Notes:Notes for my location!10 Address: SquareFeet:0 Latitude: Longitude: DatePurchased: PurchasePrice: CurrentValue: CoverPhoto:Location10_cover.png Photos:[] Files:[] Rooms:[]} {ID:4 Name:TESTasdfsdaf Description: Notes:test Address: SquareFeet:0 Latitude: Longitude: DatePurchased: PurchasePrice: CurrentValue: CoverPhoto:TESTasdfsdaf_cover.png Photos:[] Files:[] Rooms:[]}]"}
+{"logtype":"webserver", "pid":"11084", "requestid":"", "status":"200", "method":"GET", "path":"/api/locations"}
+{"level":"debug","time":"2022-04-08T22:22:52-04:00","message":"Returning Locations: [{ID:1 Name:Location4 Description: Notes:Notes for my location! Address: SquareFeet:0 Latitude: Longitude: DatePurchased: PurchasePrice: CurrentValue: CoverPhoto:Location4_cover.png Photos:[Location4_0.png Location4_1.png] Files:[] Rooms:[{ID:0 Name:Kitchen Description: Paint: Notes:Notes For My Room! SquareFeet:0 CoverPhoto:Location4/Kitchen/Kitchen_cover.png Photos:[Location4/Kitchen/Kitchen_0.png] Cabinets:[] Items:[] LocationID:1 LocationName:Location4}]} {ID:2 Name:Location6 Description: Notes:Notes for my location!6 Address: SquareFeet:0 Latitude: Longitude: DatePurchased: PurchasePrice: CurrentValue: CoverPhoto:Location6_cover.png Photos:[Location6_0.png Location6_1.png] Files:[] Rooms:[]} {ID:3 Name:Location10 Description: Notes:Notes for my location!10 Address: SquareFeet:0 Latitude: Longitude: DatePurchased: PurchasePrice: CurrentValue: CoverPhoto:Location10_cover.png Photos:[] Files:[] Rooms:[]} {ID:4 Name:TESTasdfsdaf Description: Notes:test Address: SquareFeet:0 Latitude: Longitude: DatePurchased: PurchasePrice: CurrentValue: CoverPhoto:TESTasdfsdaf_cover.png Photos:[] Files:[] Rooms:[]}]"}
+{"logtype":"webserver", "pid":"11084", "requestid":"", "status":"200", "method":"GET", "path":"/api/locations"}
+{"logtype":"webserver", "pid":"11084", "requestid":"", "status":"200", "method":"GET", "path":"/api/config"}
+{"logtype":"webserver", "pid":"11084", "requestid":"", "status":"200", "method":"GET", "path":"/photos/locations/TESTasdfsdaf/TESTasdfsdaf_cover.png"}
+{"logtype":"webserver", "pid":"11084", "requestid":"", "status":"200", "method":"GET", "path":"/photos/locations/Location4/Location4_cover.png"}
+{"logtype":"webserver", "pid":"11084", "requestid":"", "status":"200", "method":"GET", "path":"/photos/locations/Location10/Location10_cover.png"}
+{"logtype":"webserver", "pid":"11084", "requestid":"", "status":"200", "method":"GET", "path":"/photos/locations/Location6/Location6_cover.png"}
+{"level":"debug","time":"2022-04-08T22:26:15-04:00","message":"Returning Locations: [{ID:1 Name:Location4 Description: Notes:Notes for my location! Address: SquareFeet:0 Latitude: Longitude: DatePurchased: PurchasePrice: CurrentValue: CoverPhoto:Location4_cover.png Photos:[Location4_0.png Location4_1.png] Files:[] Rooms:[{ID:0 Name:Kitchen Description: Paint: Notes:Notes For My Room! SquareFeet:0 CoverPhoto:Location4/Kitchen/Kitchen_cover.png Photos:[Location4/Kitchen/Kitchen_0.png] Cabinets:[] Items:[] LocationID:1 LocationName:Location4}]} {ID:2 Name:Location6 Description: Notes:Notes for my location!6 Address: SquareFeet:0 Latitude: Longitude: DatePurchased: PurchasePrice: CurrentValue: CoverPhoto:Location6_cover.png Photos:[Location6_0.png Location6_1.png] Files:[] Rooms:[]} {ID:3 Name:Location10 Description: Notes:Notes for my location!10 Address: SquareFeet:0 Latitude: Longitude: DatePurchased: PurchasePrice: CurrentValue: CoverPhoto:Location10_cover.png Photos:[] Files:[] Rooms:[]} {ID:4 Name:TESTasdfsdaf Description: Notes:test Address: SquareFeet:0 Latitude: Longitude: DatePurchased: PurchasePrice: CurrentValue: CoverPhoto:TESTasdfsdaf_cover.png Photos:[] Files:[] Rooms:[]}]"}
+{"logtype":"webserver", "pid":"11084", "requestid":"", "status":"200", "method":"GET", "path":"/api/locations"}
+{"logtype":"webserver", "pid":"11084", "requestid":"", "status":"304", "method":"GET", "path":"/photos/locations/TESTasdfsdaf/TESTasdfsdaf_cover.png"}
+{"level":"debug","time":"2022-04-08T22:26:18-04:00","message":"Returning Locations: [{ID:1 Name:Location4 Description: Notes:Notes for my location! Address: SquareFeet:0 Latitude: Longitude: DatePurchased: PurchasePrice: CurrentValue: CoverPhoto:Location4_cover.png Photos:[Location4_0.png Location4_1.png] Files:[] Rooms:[{ID:0 Name:Kitchen Description: Paint: Notes:Notes For My Room! SquareFeet:0 CoverPhoto:Location4/Kitchen/Kitchen_cover.png Photos:[Location4/Kitchen/Kitchen_0.png] Cabinets:[] Items:[] LocationID:1 LocationName:Location4}]} {ID:2 Name:Location6 Description: Notes:Notes for my location!6 Address: SquareFeet:0 Latitude: Longitude: DatePurchased: PurchasePrice: CurrentValue: CoverPhoto:Location6_cover.png Photos:[Location6_0.png Location6_1.png] Files:[] Rooms:[]} {ID:3 Name:Location10 Description: Notes:Notes for my location!10 Address: SquareFeet:0 Latitude: Longitude: DatePurchased: PurchasePrice: CurrentValue: CoverPhoto:Location10_cover.png Photos:[] Files:[] Rooms:[]} {ID:4 Name:TESTasdfsdaf Description: Notes:test Address: SquareFeet:0 Latitude: Longitude: DatePurchased: PurchasePrice: CurrentValue: CoverPhoto:TESTasdfsdaf_cover.png Photos:[] Files:[] Rooms:[]}]"}
+{"logtype":"webserver", "pid":"11084", "requestid":"", "status":"200", "method":"GET", "path":"/api/locations"}
+{"level":"info","time":"2022-04-08T22:27:01-04:00","message":"Adding new location to database: %!(EXTRA main.Location={0 Final Test 0 Final Test_cover.png [] [] []})"}
+{"level":"debug","time":"2022-04-08T22:27:01-04:00","message":"Adding new location: {0 Final Test 0 Final Test_cover.png [] [] []}"}
+{"logtype":"webserver", "pid":"11084", "requestid":"", "status":"200", "method":"POST", "path":"/api/locations/new"}
+{"level":"debug","time":"2022-04-08T22:27:11-04:00","message":"Returning Locations: [{ID:1 Name:Location4 Description: Notes:Notes for my location! Address: SquareFeet:0 Latitude: Longitude: DatePurchased: PurchasePrice: CurrentValue: CoverPhoto:Location4_cover.png Photos:[Location4_0.png Location4_1.png] Files:[] Rooms:[{ID:0 Name:Kitchen Description: Paint: Notes:Notes For My Room! SquareFeet:0 CoverPhoto:Location4/Kitchen/Kitchen_cover.png Photos:[Location4/Kitchen/Kitchen_0.png] Cabinets:[] Items:[] LocationID:1 LocationName:Location4}]} {ID:2 Name:Location6 Description: Notes:Notes for my location!6 Address: SquareFeet:0 Latitude: Longitude: DatePurchased: PurchasePrice: CurrentValue: CoverPhoto:Location6_cover.png Photos:[Location6_0.png Location6_1.png] Files:[] Rooms:[]} {ID:3 Name:Location10 Description: Notes:Notes for my location!10 Address: SquareFeet:0 Latitude: Longitude: DatePurchased: PurchasePrice: CurrentValue: CoverPhoto:Location10_cover.png Photos:[] Files:[] Rooms:[]} {ID:4 Name:TESTasdfsdaf Description: Notes:test Address: SquareFeet:0 Latitude: Longitude: DatePurchased: PurchasePrice: CurrentValue: CoverPhoto:TESTasdfsdaf_cover.png Photos:[] Files:[] Rooms:[]} {ID:5 Name:Final Test Description: Notes: Address: SquareFeet:0 Latitude: Longitude: DatePurchased: PurchasePrice: CurrentValue: CoverPhoto:Final Test_cover.png Photos:[] Files:[] Rooms:[]}]"}
+{"logtype":"webserver", "pid":"11084", "requestid":"", "status":"200", "method":"GET", "path":"/api/locations"}
+{"logtype":"webserver", "pid":"11084", "requestid":"", "status":"200", "method":"GET", "path":"/photos/locations/Final%20Test/Final%20Test_cover.png"}
+{"logtype":"webserver", "pid":"11084", "requestid":"", "status":"304", "method":"GET", "path":"/photos/locations/TESTasdfsdaf/TESTasdfsdaf_cover.png"}
+{"level":"info","time":"2022-04-08T22:41:02-04:00","message":"Configuration loaded successfully..."}
+{"level":"debug","time":"2022-04-08T22:41:02-04:00","message":"{Timezone:America/New_York Server:{Port:3500 LocationFilesDir:./app/photos/locations/} Logger:{Level:debug LoggingFile:./app/log/goInventorize.log} Authentication:{BasicAuth:false UserName:admin Password:password} Development:false}"}
+{"level":"info","time":"2022-04-08T22:41:02-04:00","message":"Database and Config loaded, starting webserver..."}
+{"level":"info","time":"2022-04-08T22:49:49-04:00","message":"Configuration loaded successfully..."}
+{"level":"debug","time":"2022-04-08T22:49:49-04:00","message":"{Timezone:America/New_York Server:{Port:3500 LocationFilesDir:./app/files/locations/} Logger:{Level:debug LoggingFile:./app/log/goInventorize.log} Authentication:{BasicAuth:false UserName:admin Password:password} Development:false}"}
+{"level":"info","time":"2022-04-08T22:49:49-04:00","message":"Database and Config loaded, starting webserver..."}
+{"level":"info","time":"2022-04-08T22:49:55-04:00","message":"Configuration loaded successfully..."}
+{"level":"debug","time":"2022-04-08T22:49:55-04:00","message":"{Timezone:America/New_York Server:{Port:3500 LocationFilesDir:./app/files/locations/} Logger:{Level:debug LoggingFile:./app/log/goInventorize.log} Authentication:{BasicAuth:false UserName:admin Password:password} Development:false}"}
+{"level":"info","time":"2022-04-08T22:49:55-04:00","message":"Database and Config loaded, starting webserver..."}
+{"level":"info","time":"2022-04-08T22:50:26-04:00","message":"Configuration loaded successfully..."}
+{"level":"debug","time":"2022-04-08T22:50:26-04:00","message":"{Timezone:America/New_York Server:{Port:3500 LocationFilesDir:./app/files/locations/} Logger:{Level:debug LoggingFile:./app/log/goInventorize.log} Authentication:{BasicAuth:false UserName:admin Password:password} Development:false}"}
+{"level":"info","time":"2022-04-08T22:50:26-04:00","message":"Database and Config loaded, starting webserver..."}
diff --git a/config.go b/config.go
index ae1bb90..c700257 100644
--- a/config.go
+++ b/config.go
@@ -12,7 +12,7 @@ import (
var defaultConfig = `# All values in this config file WILL BE overwritten by ENV variables (GI_SERVER_PORT for example) if they exist.
Server:
port: 3500
- locationPhotoDir: "./app/photos/locations/"
+ LocationFilesDir: "./app/photos/locations/"
Logger:
loglevel: "debug" # debug/info/warn/error
@@ -31,7 +31,7 @@ type Config struct {
Timezone string `fig:"tz" default:"America/New_York"`
Server struct {
Port string `fig:"port" default:"3000"`
- LocationPhotoDir string `fig:"locationPhotoDir" default:"./app/photos/locations/"`
+ LocationFilesDir string `fig:"LocationFilesDir" default:"./app/photos/locations/"`
}
Logger struct {
Level string `fig:"loglevel" default:"info"`
@@ -101,7 +101,7 @@ func LoadConfig(s *Server) error {
}
s.Log = zerolog.New(logFile).With().Timestamp().Logger()
// Creating photo directory
- err = os.MkdirAll(cfg.Server.LocationPhotoDir, 0755)
+ err = os.MkdirAll(cfg.Server.LocationFilesDir, 0755)
if err != nil {
return err
}
diff --git a/frontend/src/components/forms/LocationForm.js b/frontend/src/components/forms/LocationForm.js
index eb1bc9f..d351af9 100644
--- a/frontend/src/components/forms/LocationForm.js
+++ b/frontend/src/components/forms/LocationForm.js
@@ -23,7 +23,7 @@ function LocationForm(props) {
Description: '',
Notes: '',
Address: '',
- SquareFeet: 0,
+ SquareFeet: '',
Latitude: '',
Longitude: '',
DatePurchased: '',
@@ -34,7 +34,7 @@ function LocationForm(props) {
},
validate: {
-
+ Name: (value) => (/^\S+/.test(value) ? null : 'Invalid Name')
},
});
@@ -45,8 +45,19 @@ function LocationForm(props) {
const submitNewLocation = (values) => {
console.log("VALUES: ", values)
- const formData = new FormData(values)
+ // let additionalPhotos = values.AdditionalPhotos
+ let formData = new FormData()
+ for (const [key, value] of Object.entries(values)) {
+ if (key === "AdditionalPhotos" && value.length > 0) {
+ value.forEach(photo => {
+ console.log("PHOTO VALUE: ", photo)
+ formData.append(key, photo)
+ });
+ }
+ formData.append(key, value)
+ }
backendAPI.post("/locations/new", formData).then((result) => {
+ console.log("STATUS: ", result.status)
console.log("result: ", result.data)
}).catch(err => {
console.log("Error adding new location!", err)
@@ -108,7 +119,7 @@ function LocationForm(props) {