Skip to content

Commit

Permalink
Updated Birthday API
Browse files Browse the repository at this point in the history
  • Loading branch information
beanbeanjuice committed Nov 17, 2024
1 parent 661b9da commit 3e026bc
Show file tree
Hide file tree
Showing 3 changed files with 95 additions and 252 deletions.
92 changes: 87 additions & 5 deletions api/v1/.gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Environmente File
.env
# Node/NPM
/node_modules/

# Latex Files
*.aux
*.fdb_latexmk
*.fls
*.synctex.gz

# Compiled class file
*.class
Expand All @@ -22,30 +28,106 @@
*.tar.gz
*.rar

# C Files
*.o
*.out

# Maven
/target/

# Gradle
/build/
/.gradle/
/out/
gradle.properties
/node_modules/

# IntelliJ IDEA
# JetBrains IDEA
/.idea/
/.fleet/
*.iml
*.ipr
*.iws

# VSCode
.vscode/

# Eclipse
.classpath
.project
.settings/
/bin/

# Files containing safety info
.env
beta.json
release.json

# Logging Stuff
/logs/

# Mac Stuff
.DS_Store

# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
hs_err_pid*

# GITIGNORE FOR C PROJECTS
# Prerequisites
*.d

# Object files
*.o
*.ko
*.obj
*.elf

# Linker output
*.ilk
*.map
*.exp

# Precompiled Headers
*.gch
*.pch

# Libraries
*.lib
*.a
*.la
*.lo

# Shared objects (inc. Windows DLLs)
*.dll
*.so
*.so.*
*.dylib

# Executables
*.exe
*.out
*.app
*.i*86
*.x86_64
*.hex

# Debug files
*.dSYM/
*.su
*.idb
*.pdb
/cmake-build-debug/

# Kernel Module Compile Results
*.mod*
*.cmd
.tmp_versions/
modules.order
Module.symvers
Mkfile.old
dkms.conf

# Rust Stuff
debug/
target/
**/*.rs.bk
*.pdb
11 changes: 6 additions & 5 deletions api/v1/routes/cafeBot/birthdays.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,15 +165,16 @@ router.patch("/birthdays/:user_id/mention", check_authentication, check_admin, c
// TODO: Test this.
// Creates a birthday
router.post("/birthdays/:user_id", check_authentication, check_admin, check_if_user_does_not_exist, (request, response, next) => {
user_id = request.params.user_id;
birthday = request.query.birthday;
time_zone = request.query.time_zone;
const user_id = request.params.user_id;
const birthday = request.query.birthday;
const time_zone = request.query.time_zone;

if (!birthday) {
if (!birthday || !time_zone) {
response.status(400).json({
variables: {
user_id: user_id,
birthday: birthday || "undefined"
birthday: birthday || "undefined",
time_zone: time_zone || "undefined"
},
message: "A Variable is Undefined"
});
Expand Down
Loading

0 comments on commit 3e026bc

Please sign in to comment.