Skip to content

Commit

Permalink
Merge branch 'develop' into notification_preferences
Browse files Browse the repository at this point in the history
  • Loading branch information
Nishant Samel committed Jun 26, 2024
2 parents 1bbb798 + ae4babf commit 1409fcf
Show file tree
Hide file tree
Showing 135 changed files with 1,209 additions and 7,120 deletions.
11 changes: 0 additions & 11 deletions app/controllers/internal_api/v1/profile_controller.rb
Original file line number Diff line number Diff line change
@@ -1,17 +1,6 @@
# frozen_string_literal: true

class InternalApi::V1::ProfileController < InternalApi::V1::ApplicationController
def show
authorize :show, policy_class: ProfilePolicy
render :show, locals: { user: current_user }, status: :ok
end

def remove_avatar
authorize :remove_avatar, policy_class: ProfilePolicy
current_user.avatar.destroy
render json: { notice: "Avatar deleted successfully" }, status: :ok
end

def update
authorize :update, policy_class: ProfilePolicy
service = UpdateProfileSettingsService.new(current_user, user_params).process
Expand Down
20 changes: 0 additions & 20 deletions app/javascript/src/apis/profile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,10 @@ import axios from "./api";

const path = "/profile";

const index = () => axios.get(path);

const getAddress = id => axios.get(`/users/${id}/addresses`);

const update = payload => axios.put(`${path}`, payload);

const upadteAvatar = (payload, config) => axios.put(`${path}`, payload, config);

const createAddress = (userId, payload) =>
axios.post(`/users/${userId}/addresses`, payload);

const updateAddress = (userId, addressId, payload) =>
axios.put(`/users/${userId}/addresses/${addressId}`, payload);

const removeAvatar = () => axios.delete(`${path}/remove_avatar`);

const profileApi = {
index,
update,
removeAvatar,
getAddress,
updateAddress,
createAddress,
upadteAvatar,
};

export default profileApi;
4 changes: 2 additions & 2 deletions app/javascript/src/apis/team.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ const updateTeamMember = (id, payload) => axios.put(`${path}/${id}`, payload);

const destroyTeamMemberAvatar = id => axios.delete(`${path}/${id}/avatar`);

const updateTeamMemberAvatar = (id, payload) =>
axios.put(`${path}/${id}/avatar`, payload);
const updateTeamMemberAvatar = (id, payload, config) =>
axios.put(`${path}/${id}/avatar`, payload, config);

const updateTeamMembers = payload =>
axios.put(`${path}/update_team_members`, payload);
Expand Down

This file was deleted.

This file was deleted.

Loading

0 comments on commit 1409fcf

Please sign in to comment.