Ignore:
Timestamp:
01/05/23 04:11:40 (23 months ago)
Author:
andrejtodorovski <82031894+andrejtodorovski@…>
Branches:
main
Children:
1bd8d1e
Parents:
7d43957
Message:

Added admin view of pending roles and approve functionality

Location:
src/main/java/com/example/autopartz/service
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/main/java/com/example/autopartz/service/UserService.java

    r7d43957 r676144b  
    88    List<User> findAllUsers();
    99    User findByUsername(String username);
    10 
     10    User findById(Integer id);
    1111}
  • src/main/java/com/example/autopartz/service/impl/UserServiceImpl.java

    r7d43957 r676144b  
    11package com.example.autopartz.service.impl;
    22
     3import com.example.autopartz.model.Role;
    34import com.example.autopartz.model.User;
    45import com.example.autopartz.repository.UserRepository;
     
    67import org.springframework.stereotype.Service;
    78
     9import java.util.Collections;
    810import java.util.List;
    911
     
    2527        return userRepository.findAllByUsername(username).stream().findFirst().orElseThrow(RuntimeException::new);
    2628    }
     29
     30    @Override
     31    public User findById(Integer id) {
     32        return userRepository.findById(id).get();
     33    }
    2734}
Note: See TracChangeset for help on using the changeset viewer.