-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
a number of improvements/updates tot he data returned by invite endpo…
…ints to be consisten (rust tends to get very whiny when the required fields dont show up, which is FINE but we need to be consistent). also, adding some functions for getting the profile size, and implementing in the GET /users/<userid> endpoint generally called ONCE post-login. so far so good. for now only takes note data/file data into account. seems like a good bet. i guess it would be possible to store gigabytes of data in a board or space title, but we will cross that bridge when some clever jerk discovers THIS ONE SIMPLE TRICK THAT HAS DEVELOPERS FURIOUS
- Loading branch information
1 parent
bf57f9c
commit 054c4b6
Showing
7 changed files
with
144 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
- calculate storage (see user model) | ||
- on space delete, delete keychain entries for that space | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
var error = require('../helpers/error'); | ||
var space_model = require('./space'); | ||
|
||
exports.get_profile_size = function(user_id) { | ||
// grab the user's owned spaces | ||
return space_model.get_by_user_id(user_id, {role: space_model.roles.owner}) | ||
.then(function(owned_spaces) { | ||
// grab the size for each space | ||
return Promise.all(owned_spaces.map(function(space) { | ||
return space_model.get_space_size(space.id); | ||
})); | ||
}) | ||
.then(function(space_sizes) { | ||
return space_sizes.reduce(function(acc, x) { return acc + x; }, 0); | ||
}); | ||
}; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters