mirror of https://github.com/halo-dev/halo
Fix theme activation bug
parent
ea761fa73f
commit
175739dbd4
|
@ -19,8 +19,8 @@ import java.util.Map;
|
|||
* @author johnniang
|
||||
* @date 19-4-20
|
||||
*/
|
||||
@Component
|
||||
@Slf4j
|
||||
@Component
|
||||
public class FreemarkerConfigAwareListener {
|
||||
|
||||
private final OptionService optionService;
|
||||
|
|
|
@ -210,7 +210,7 @@ public interface ThemeService {
|
|||
* @return theme property
|
||||
*/
|
||||
@NonNull
|
||||
ThemeProperty activeTheme(@NonNull String themeId);
|
||||
ThemeProperty activateTheme(@NonNull String themeId);
|
||||
|
||||
/**
|
||||
* Upload theme.
|
||||
|
|
|
@ -316,7 +316,7 @@ public class ThemeServiceImpl implements ThemeService {
|
|||
}
|
||||
|
||||
@Override
|
||||
public ThemeProperty activeTheme(String themeId) {
|
||||
public ThemeProperty activateTheme(String themeId) {
|
||||
// Check existence of the theme
|
||||
ThemeProperty themeProperty = getThemeOfNonNullBy(themeId);
|
||||
|
||||
|
@ -508,6 +508,7 @@ public class ThemeServiceImpl implements ThemeService {
|
|||
*/
|
||||
private void setActivatedTheme(@Nullable ThemeProperty activatedTheme) {
|
||||
this.activatedTheme = activatedTheme;
|
||||
this.activatedThemeId = activatedTheme.getId();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -71,7 +71,7 @@ public class ThemeController {
|
|||
@PostMapping("{themeId}/activation")
|
||||
@ApiOperation("Activates a theme")
|
||||
public ThemeProperty active(@PathVariable("themeId") String themeId) {
|
||||
return themeService.activeTheme(themeId);
|
||||
return themeService.activateTheme(themeId);
|
||||
}
|
||||
|
||||
@GetMapping("activation")
|
||||
|
|
Loading…
Reference in New Issue