Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 28 additions & 28 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -7,39 +7,39 @@ npx lint-staged
echo "🧪 Running tests..."
npm test

# Run Spectral linting on Postman collections if they changed
if git diff --cached --name-only | grep -qE "postman/collections/"; then
echo "📋 Linting Postman collections with Spectral..."
node .spectral/lint-with-names.js
# # Run Spectral linting on Postman collections if they changed
# if git diff --cached --name-only | grep -qE "postman/collections/"; then
# echo "📋 Linting Postman collections with Spectral..."
# node .spectral/lint-with-names.js

if [ $? -ne 0 ]; then
echo "❌ Spectral linting failed for Postman collections"
exit 1
fi
# if [ $? -ne 0 ]; then
# echo "❌ Spectral linting failed for Postman collections"
# exit 1
# fi

echo "✅ Postman collection linting passed!"
fi
# echo "✅ Postman collection linting passed!"
# fi

# Run Postman tests only if Postman collection files changed
if git diff --cached --name-only | grep -qE "postman/"; then
echo "📬 Postman collection changed - Running Postman tests..."
# # Run Postman tests only if Postman collection files changed
# if git diff --cached --name-only | grep -qE "postman/"; then
# echo "📬 Postman collection changed - Running Postman tests..."

# Run all collections in postman/collections/
for collection in postman/collections/*.postman_collection.json; do
if [ -f "$collection" ]; then
echo " → Running: $(basename "$collection")"
postman collection run "$collection"
# # Run all collections in postman/collections/
# for collection in postman/collections/*.postman_collection.json; do
# if [ -f "$collection" ]; then
# echo " → Running: $(basename "$collection")"
# postman collection run "$collection"

if [ $? -ne 0 ]; then
echo "❌ Postman collection failed: $collection"
exit 1
fi
fi
done
# if [ $? -ne 0 ]; then
# echo "❌ Postman collection failed: $collection"
# exit 1
# fi
# fi
# done

echo "✅ All Postman collections passed!"
else
echo "⏭️ No Postman collection changes detected, skipping Postman tests"
fi
# echo "✅ All Postman collections passed!"
# else
# echo "⏭️ No Postman collection changes detected, skipping Postman tests"
# fi

echo "✅ All pre-commit checks passed!"
12 changes: 0 additions & 12 deletions .postman/config.json

This file was deleted.

235 changes: 0 additions & 235 deletions postman/collections/Intergalactic Bank API.postman_collection.json

This file was deleted.

7 changes: 0 additions & 7 deletions postman/globals/workspace.postman_globals.json

This file was deleted.

48 changes: 24 additions & 24 deletions src/routes/accounts.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,33 +40,33 @@ router.get('/', validateApiKey, (req, res) => {
* GET /api/v1/accounts/:accountId
* Get a specific account by ID
*/
router.get('/:accountId', validateApiKey, (req, res) => {
try {
const { accountId } = req.params;
// router.get('/:accountId', validateApiKey, (req, res) => {
// try {
// const { accountId } = req.params;

const account = db.getAccountById(accountId);
// const account = db.getAccountById(accountId);

if (!account) {
return res.status(404).json({
error: {
name: 'instanceNotFoundError',
message: 'The specified account does not exist.'
}
});
}
// if (!account) {
// return res.status(404).json({
// error: {
// name: 'instanceNotFoundError',
// message: 'The specified account does not exist.'
// }
// });
// }

res.status(200).json({
account: account.toJSON()
});
} catch (error) {
res.status(500).json({
error: {
name: 'serverError',
message: 'Failed to retrieve account'
}
});
}
});
// res.status(200).json({
// account: account.toJSON()
// });
// } catch (error) {
// res.status(500).json({
// error: {
// name: 'serverError',
// message: 'Failed to retrieve account'
// }
// });
// }
// });

/**
* POST /api/v1/accounts
Expand Down
Loading