Skip to content
Open
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
Binary file added .DS_Store
Binary file not shown.
5 changes: 4 additions & 1 deletion app/Http/Controllers/Users/TeamInvitesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@ public function store(CreateTeamInviteRequest $request, Team $team)
}

if ($team->hasInvite($user)) {
abort(400, $user->email . ' has already been invited to this team.');
abort(
400,
$user->email . ' has already been invited to this team.'
);
}

$data = [
Expand Down
4 changes: 3 additions & 1 deletion app/Http/Resources/UserResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ public function toArray($request)
// 'api_token' => $this->api_token,
'photo_url' => $this->photo_url,
'teams' => TeamResource::collection($this->teams),
'team_memberships' => $this->memberships()->with(['team:id,name'])->get(),
'team_memberships' => $this->memberships()
->with(['team:id,name'])
->get(),
'team_invites' => $this->invites()->with(['team.user']),
'auth_provider' => $this->auth_provider,
'server_count' => $serverCount,
Expand Down
9 changes: 6 additions & 3 deletions app/Team.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,20 @@ public function hasMember(User $user)
return true;
}

return (bool) $this->invites()->where('status', 'accepted')
return (bool) $this->invites()
->where('status', 'accepted')
->where('user_id', $user->id)
->first();
}

public function hasInvite(User $user) {
public function hasInvite(User $user)
{
if ((int) $this->user_id === (int) $user->id) {
return false;
}

return (bool) $this->invites()->where('user_id', $user->id)
return (bool) $this->invites()
->where('user_id', $user->id)
->first();
}
}
Binary file modified public/.DS_Store
Binary file not shown.
Binary file modified public/assets/.DS_Store
Binary file not shown.
Binary file modified public/assets/images/.DS_Store
Binary file not shown.
Binary file added public/assets/images/add-database.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/images/add-firewall-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/images/add-firewall.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/images/add-server-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/images/add-server-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/images/connect-src-ctrl.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion public/js/14.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading